Problem

Source: 2022 Nigerian MO Round 3/Problem 1

Tags: Sequence, algebra



Integer sequence $(x_{n})$ is defined as follows; $x_{1} = 1$, and for each integer $n \geq 1$, $x_{n+1}$ is equal to the largest number that can be obtained by permutation of the digits of $x_{n}+2$. Find the smallest $n$ for which the decimal representation of $x_{n}$ contains exactly $2022$ digits