11.3. For any natural number $m$, we denote by $S(m)$ the sum of the digits of the number $m$. Calculate $S\left(S\left(S\left(2023^{2023}\right)\right)\right)$.
## Solution.

For any natural number $m$, we denote by $S(m)$ the sum of the digits and by $N(m)$ the number of digits of the number $m$. We have $2023^{2023}<\left(10^{4}\right)^{2023}=10^{8092}$, which implies $N\left(2023^{2023}\right) \leq 8092$. The number $2023^{2023}$ has no more than 8092 digits, and the sum of its digits does not exceed $9 \cdot 8092$, that is,

$$
0<S\left(2023^{2023}\right) \leq 9 \cdot 8092=72828
$$

The number $S\left(2023^{2023}\right)$ does not exceed the number 72828, and the sum of its digits does not exceed the sum of the digits of the number 79999 (we keep the value 7 for the first digit (as the maximum value), and replace the other digits with the maximum value 9). As a result, we obtain the inequality

$$
0<S\left(S\left(2023^{2023}\right)\right) \leq S(79999)=43
$$

Similarly, the number $S\left(S\left(2023^{2023}\right)\right)$ does not exceed the number 43, and the sum of its digits does not exceed the sum of the digits of the number 49 (we keep the value 4 for the first digit (as the maximum value), and replace the second digit with the maximum value 9). We obtain

$$
0<S\left(S\left(S\left(2023^{2023}\right)\right)\right) \leq S(49)=13
$$

It is known that at division by 9, any natural number $m$ and the sum of its digits give the same remainder, i.e., $m \equiv S(m)(\bmod 9), \forall m \in \mathbb{N}$. Therefore,

$$
2023^{2023} \equiv(S(2023))^{2023} \equiv 7^{2023} \equiv\left(7^{3}\right)^{674} \cdot 7 \equiv 1^{674} \cdot 7 \equiv 7(\bmod 9)
$$

Correspondingly, applying the congruence property modulo 9 recursively three times, we have

$$
S\left(S\left(S\left(2023^{2023}\right)\right)\right) \equiv S\left(S\left(2023^{2023}\right)\right) \equiv S\left(2023^{2023}\right) \equiv 2023^{2023} \equiv 7(\bmod 9)
$$

Consequently, from relations $(*)$ and $(* *)$, we obtain

$$
S\left(S\left(S\left(2023^{2023}\right)\right)\right)=7
$$