Problem

Source: Romanian team selection test 1994, 3rd exam, problem 1

Tags: quadratics, modular arithmetic, number theory proposed, number theory



Find the smallest nomial of this sequence that $a_1=1993^{1994^{1995}}$ and \[ a_{n+1}=\begin{cases}\frac{a_n}{2}&\text{if $n$ is even}\\a_n+7 &\text{if $n$ is odd.} \end{cases} \]