The recursion is inconsistent because $a_{n+2}=a_{n+1}$ and $a_{n+1}=2a_n$ cannot both hold for all $n$ (or all $n$ after some initial values).
The sequence $1,2,2,4,4,8,8,16,16,\dots$ with the indexing as in the question is given by $2^{\lfloor \frac{n}{2} \rfloor}$.
Assuming you know how to solve the recursion $b_{i+1}=2b_i$, the problem amounts to the fact that a function of integers with $f(2k)=f(2k+1)$ for all $k$ can be written as a function of ($n$ DIV 2), and that integer division operation DIV can be written using the Greatest Integer function $\lfloor x \rfloor$.