Inspired by this simple question at HackerRank, I was wondering if the following sequence has a closed-form:
$$a_0 = 1; \qquad a_n = \begin{cases} a_{n-1} + 1, & \text{if }n\text{ is even} \\[4pt] 2(a_{n-1}), & \text{if }n\text{ is odd} \end{cases}$$
For example, starting at $n=0$, we have:
$1,2,3,6,7,14,\ldots$