Looking for a formula to represent the sequence $2,4,2,8,2,4,2,16,2,4,2,8,\dots$ Is there a formula with which I can represent the sequence $2,4,2,8,2,4,2,16,2,4,2,8,\dots$?

Let $P_n$ denote the number of zeros at the end of the binary representation of $n$.
Note that $P_n$ also gives the number of times that $n$ is divisible by $2$.
Your sequence can be represented as: $$a_n=2^{P_n+1}$$
