# A good sequence

A sequence of real numbers $$a_0, a_1, a_2 \ldots$$ is said to be good if the following three conditions hold.

• The value of $$a_0$$ is a positive integer.
• For each non-negative integer $$i$$ we have $$a_{i+1}=2a_i+1$$ or $$a_{i+1}=\dfrac{a_i}{a_i+2}$$.
• There exists a positive integer $$k$$ such that $$a_k=2014$$.

Find the smallest positive integer $$n$$ such that there exists a good sequence $$a_0, a_1, a_2 \ldots$$ of real numbers with the property that $$a_n=2014$$.

×