I'm having difficulty in finding the formula for the sequence above, when I put this in WolframAlpha it gave me a rather complex formula which I'm not convinced even works properly but I'm sure there's a simple way to achieve this. I've searched for many similar sequences but couldn't find anything that helped me.
I'm thinking I'll most likely need to have a condition for even numbers and another for noneven numbers.
Any help would be highly appreciated.
$\endgroup$23 Answers
$\begingroup$These are just powers of two. So: $2^{\lfloor n / 2\rfloor}$
$\endgroup$2$\begingroup$Alternatively, this is an example of a sequence where the $n$th term is a fixed linear combination of the immediately previous terms: We can write it as $$a_n = 2 a_{n - 2}, \qquad a_0 = a_1 = 1.$$ Using the ansatz $a_n = C r^n$ and substituting in the recursion formula gives $C r^n = 2 C r^{n - 2}$. Rearranging and clearing gives the characteristic equation $r^2 - 2 = 0$, whose solutions are $\pm \sqrt{2}$. So, the general solution is $$a_n = A (\sqrt{2})^n + B(-\sqrt{2})^n = (\sqrt{2})^n [A + B(-1)^n] .$$ Substituting the initial values $a_0 = a_1 = 1$ gives a linear system in the coefficients $A, B$.
$\endgroup$$\begingroup$The sequence is the powers of two, each repeated twice. We can encode the latter feature using the quantity $\lfloor \frac{n}{2} \rfloor$, which has values $0, 0, 1, 1, 2, 2, \ldots$.
$\endgroup$So, the sequence is given (for appropriate indexing) by $$\color{#df0000}{\boxed{a_n := 2^{\lfloor n / 2 \rfloor}}} .$$