I am working on some project that needs to calculate what $a_n$ element of the set of numbers $1, 1, 2, 2, 4, 4, 8, 8, 16, 16 \ldots$ will be.
$n$ can be quite big number so for performance issues I have to calculate formula for this set of numbers (Note: first element may be different). What I've done so far is that I managed to find out how to calculate next element using element before. My formula for this is:
$a_n = a_{n-1}\cdot 2^{\frac{1 + (-1)^{n-1}}2}$
Now from this I want to calculate $a_n$ element using $a_1$ element. with this I am stuck.