Problem

Source: ITAMO 2016, Problem 5

Tags: algebra, Sequence



Let $x_0,x_1,x_2,\ldots$ be a sequence of rational numbers defined recursively as follows: $x_0$ can be any rational number and, for $n\ge 0$, \[ x_{n+1}=\begin{cases} \left|\frac{x_n}2-1\right| & \text{if the numerator of }x_n\text{ is even}, \\ \left|\frac1{x_n}-1\right| & \text{if the numerator of }x_n\text{ is odd},\end{cases} \]where by numerator of a rational number we mean the numerator of the fraction in its lowest terms. Prove that for any value of $x_0$: (a) the sequence contains only finitely many distinct terms; (b) the sequence contains exactly one of the numbers $0$ and $2/3$ (namely, either there exists an index $k$ such that $x_k=0$, or there exists an index $m$ such that $x_m=2/3$, but not both).