A common term for $a_n=\begin{cases} 2a_{n-1} & \text{if } n\ \text{ is even, }\\ 2a_{n-1}+1 & \text{if } n\ \text{ is odd. } \end{cases}$ When I was answering a question here, I found a sequence as a recursive one as given below. 
$a_1=1$, and for $n>1$, 
$$a_n=\begin{cases}
2a_{n-1} & \text{if } n\ \text{ is even, }\\
2a_{n-1}+1 & \text{if } n\ \text{ is odd. }
\end{cases}$$
I need to find a common term for this sequence. For example, for the sequence $a_1=2$ and $a_n=2a_{n-1}$, for $n>1$, the common term is $a_n=2^n$.
I appreciate any answer or hint in advance.

Note that in binary we have 
$$\begin{align*}
a_1&=1\\
a_2&=10\\
a_3&=101\\
a_4&=1010\\
a_5&=10101\;,
\end{align*}$$
displaying a pattern easily shown by induction to be real. Now note that the binary expansion of $\frac23$ is $\frac23=0.\overline{10}_{\text{two}}$, so that 
$$\begin{align*}
2\cdot\frac23&=1.\overline{01}_{\text{two}}\\
2^2\cdot\frac23&=10.\overline{10}_{\text{two}}\\
2^3\cdot\frac23&=101.\overline{01}_{\text{two}}\\
2^4\cdot\frac23&=1010.\overline{10}_{\text{two}}\\
2^5\cdot\frac23&=10101.\overline{01}_{\text{two}}\;,
\end{align*}$$
and therefore
$$a_n=\left\lfloor 2^n\cdot\frac23\right\rfloor=\left\lfloor\frac{2^{n+1}}3\right\rfloor\;.$$
If you really want to get rid of the floor function, observe that $2^{n+1}\equiv 1\pmod3$ when $n$ is odd, and $2^{n+1}\equiv2\pmod3$ when $n$ is even, so
$$\left\lfloor\frac{2^{n+1}}3\right\rfloor=\begin{cases}
\dfrac{2^{n+1}-1}3,&\text{if }n\text{ is odd}\\
\dfrac{2^{n+1}-2}3,&\text{if }n\text{ is even}\;.
\end{cases}$$
Now
$$\frac12\big(1+(-1)^n\big)=\begin{cases}
0,&\text{if }n\text{ is odd}\\
1,&\text{if }n\text{ is even}\;,
\end{cases}$$
so
$$\begin{align*}
\left\lfloor\frac{2^{n+1}}3\right\rfloor&=\frac13\left(2^{n+1}-1-\frac12\big(1+(-1)^n\big)\right)\\
&=\frac13\left(2^{n+1}-\frac12\left(3+(-1)^n\right)\right)\\
&=\frac16\left(2^{n+2}-3-(-1)^n\right)\;.
\end{align*}$$
