Problem

Source: Baltic Way 1997

Tags: number theory proposed, number theory



In a sequence $u_0,u_1,\ldots $ of positive integers, $u_0$ is arbitrary, and for any non-negative integer $n$, \[ u_{n+1}=\begin{cases}\frac{1}{2}u_n & \text{for even }u_n \\ a+u_n & \text{for odd }u_n \end{cases} \] where $a$ is a fixed odd positive integer. Prove that the sequence is periodic from a certain step.