11.1. Let $\left(a_{n}\right)_{n=1}^{\infty}$ be a sequence of integers that satisfies the relation $a_{n+1}=a_{n}^{1009}+3^{2017}, \forall n \geq 1$. How many perfect squares can this sequence contain? Justify your answer.
Solution. The possible values of the pairs $\left(a_{n} \bmod 4, a_{n+1} \bmod 4\right)$ are $(0,3),(1,0),(2,3)$ and $(3,2)$. Therefore, regardless of the value of $a_{1}$, all terms $a_{n}, n \geq 3$, are equal to 2 or $3(\bmod 4)$ and, thus, are not perfect squares. In conclusion, we have at most two perfect square terms: $a_{1}$ and $a_{2}$.

Let's prove that $a_{1}$ and $a_{2}$ cannot both be perfect squares. Suppose the contrary, $a_{1}=a^{2}$ and $a_{2}=b^{2}$, where $a$ and $b$ are natural numbers. We have $b^{2}=a^{2018}+3^{2017}$, equivalent to $\left(b-a^{1009}\right)\left(b+a^{1009}\right)=3^{2017}$, which implies $b-a^{1009}=3^{s}$ and $b+a^{1009}=3^{t}$, where the natural numbers $s$ and $t$ satisfy the relations $s+t=2017$ and $s \leq t$. Thus, $2 a^{1009}=3^{s}\left(3^{t-s}-1\right)$, where $s+t=2017$ and $s \leq 1008$.

If $s>0$, then $3^{s}\left(3^{t-s}-1\right) \mathrm{M}$ and, thus, $2 a^{1009} \mathrm{MB}$, which implies $a^{1009}$ M $\mathbb{B}^{1009}$. It follows that the right-hand side $3^{s}\left(3^{t-s}-1\right)$ is divisible by $3^{1009}$, which is impossible due to the inequality $s \leq 1008$.

If $s=0$, then $2 a^{1009}=3^{2017}-1$. We have $a^{1009}<3^{2017}-1<3^{2018}=9^{1009}$ and, thus, $a<9$. Since $3^{2017}-1 \equiv 2(\bmod 4)$, it follows that $a$ is odd, which implies $a \in\{1,3,5,7\}$. The case $a=1$ is impossible since $2 \neq 3^{2017}-1$. The case $a=3$ is impossible since $3^{2017}-1$ is not divisible by 3. The case $a=5$ is impossible since $2 \cdot 5^{1009} \mathrm{M} 0$, but $3^{2017}-1 \equiv 2(\bmod 10)$. The case $a=7$ is impossible since $3^{2017}-1 \equiv 2(\bmod 7)$.

Therefore, the numbers $a_{1}$ and $a_{2}$ cannot both be perfect squares. In conclusion, among the terms of the sequence $\left(a_{n}\right)_{n=1}^{\infty}$, we can find at most one perfect square (for example, if $a_{1}$ is a perfect square).