### APMO 2019 P2

Posted:

**Thu Aug 15, 2019 8:42 pm**Let $m$ be a fixed positive integer. The infinite sequence $\{a_n\}_{n\geq 1}$ is defined in the following way: $a_1$ is a positive integer, and for every integer $n\geq 1$ we have

$$a_{n+1} = \begin{cases}a_n^2+2^m & \text{if } a_n< 2^m \\ a_n/2 &\text{if } a_n\geq 2^m\end{cases}$$For each $m$, determine all possible values of $a_1$ such that every term in the sequence is an integer.

$$a_{n+1} = \begin{cases}a_n^2+2^m & \text{if } a_n< 2^m \\ a_n/2 &\text{if } a_n\geq 2^m\end{cases}$$For each $m$, determine all possible values of $a_1$ such that every term in the sequence is an integer.