MathLabs

Problem 1

For each integer a0>1a_0>1, define the sequence a0,a1,a2,…a_0,a_1,a_2,\ldots for n≥0n\ge 0 by an+1={anif an is an integer,an+3otherwise.a_{n+1}=\begin{cases}\sqrt{a_n} & \text{if }\sqrt{a_n}\text{ is an integer},\\ a_n+3 & \text{otherwise}.\end{cases} Determine all values of a0a_0 for which there exists a number AA such that an=Aa_n=A for infinitely many values of nn.
Step 2 of 5: Divisibility by 3 is an invariant
3∣an  ⟺  3∣a03\mid a_n \iff 3\mid a_0
Detailed analysis

Adding 33 never changes the residue modulo 33. If ana_n is a perfect square, write an=k2a_n=k^2; since 33 is prime, 3∣k23\mid k^2 exactly when 3∣k3\mid k, so taking the square root neither creates nor destroys a factor of 33. Hence whether 3∣an3\mid a_n is the same for every nn as it is for a0a_0.