Write a general term formula of sequence 1,2,2,4,3,8,4,16,5

Write a general term formula of sequence 1,2,2,4,3,8,4,16,5


Odd digits are 1, 2, 3, 4, 5
Even bits are 2, 4, 8, 16
A (n) = (n + 1) / 2 (n is odd)
A (n) = 2 ^ (n / 2) (n is even)



Given the recurrence formula of sequence, how to find the general term of sequence
Given that B (n + 1) = 1 / (2-B (n)), how to find the general term formula of sequence of numbers,


Let the first term be B1. From the title, B (n + 1) - 1 = (b (n) - 1) / (2-B (n))
(b(n+1)-1)/(b(n)-1)=1/(2-b(n))
(b(n)-1)/(b(n+1)-1)=2-b(n)
1/(b(n+1)-1)=(2-b(n))/(b(n)-1)=-1+1/(b(n)-1)
1/(b(n+1)-1)-1/(b(n)-1) =-1
If B 1 = 1, the sequence {B (n)} is a constant sequence of 1
B1 ≠ 1, the sequence {1 / (b (n) - 1)} is an arithmetic sequence with the first term of 1 / (b1-1) and the tolerance of - 1
That is, 1 / (b (n) - 1) = 1 / (b1-1) - (n-1) = B1 / (b1-1) - N, then B (n) = (b1-1) / [b1-n * (b1-1)] + 1



Finding general term formula with known recurrence sequence formula
How to find the general term formula of the second order recurrence sequence of an = (n-1) (An-2 + an-1)


An=(n-1)(An-2+An-1)
An-1=(n-2)(An-3+An-2)
Subtraction of two formulas
An-An-1=(n-1)(An-2+An-1)-(n-2)(An-3+An-2)=An-2+(n-1)An-1-(n-2)An-3
therefore
An=An-2+nAn-1-(n-2)An-3
An-nan-1 = An-2 - (n-2) an-3
Let BN = an-nan-1, then BN = B (n-2)
This problem obviously needs to know A1, A2, and then A3 = 2 (a1 + A2)
B2=A2-2A1,B3=A3-3A2=2(A1+A2)-3A2=2A1-A2=-B2
Then b2k = B2 = a2-2a1 = a2k-2ka2k-1 = (- 1) ^ 2K * B2
B2k+1=B3=-B2=2A1-A2=A2k+1-(2k+1)A2k=(-1)^(2k+1)*B2
The two forms can be unified as
An-nAn-1=(-1)^n*B2
If A2 = 2A1, then B2 = 0, then an = nan-1 = n! A1. Otherwise, there is no unified general term formula