Let's denote by $s(n)$ the sum of the digits of the number $n$. For example, $s(2345) = 2 + 3 + 4 + 5 = 14$. Observe that:

$40 - s(40) = 36 = 9 \times 4; 500 - s(500) = 495 = 9 \times 55; 2345 - s(2345) = 2331 = 9 \times 259$.

(a) What can we say about the number $n - s(n)$?

(b) Using the previous item, calculate $s\left(s\left(s\left(2^{2009}\right)\right)\right)$.

HINT: Show that the number sought is less than 9.

## Solutions of Level 3

## List 1
(a) Observe these two examples:

$$
\underbrace{2000}_{2 \cdot 10^3}-\underbrace{s(2000)}_{2}=1998, \underbrace{60000}_{6 \cdot 10^4}-\underbrace{s(60000)}_{6}=59994
$$

From these, it is easy to understand that if $a$ is a digit between 1 and 9, then $s\left(a \cdot 10^{k}\right)=a$.

Thus, we have:

$$
a \cdot 10^{k}-s\left(a \cdot 10^{k}\right)=a \cdot 10^{k}-a=a\left(10^{k}-1\right)=a \times \underbrace{9 \cdots 9}_{k \text { nines }}=a \times 9 \times \underbrace{1 \cdots 1}_{k \text { ones }}
$$

Since every number can be decomposed into units, tens, hundreds, etc., that is, every number can be written in the form:

$$
n=a_{0}+a_{1} \cdot 10+a_{2} \cdot 10^{2}+\cdots+a_{k} \cdot 10^{k}
$$

we have that

$$
n-s(n)=a_{1} \times 9+a_{2} \times 99+\cdots a_{k} \times \underbrace{9 \cdots 9}_{k \text { nines }}
$$

Therefore, the difference $n-s(n)$ is always divisible by 9.

(b) Following the same reasoning, we have that $s(n)-s(s(n))$ and $s(s(n))-s(s(s(n)))$ are divisible by 9, so $n-s(s(s(n)))$ is divisible by 9. In particular, $2^{2009}-s(s(s(2^{2009})))$ is divisible by 9, or equivalently, $2^{2009}$ and $s(s(s(2^{2009})))$ leave the same remainder when divided by 9.

Since $2^{6}-1=63$ is divisible by 9, then $\left(2^{6}\right)^{334}-1=2^{2004}-1$ is divisible by 9, and therefore, $2^{2009}-2^{5}$ is divisible by 9. Since $2^{5}=32$ leaves a remainder of 5 when divided by 9, we have that $2^{2009}$ leaves a remainder of 5 when divided by 9.

On the other hand,

$$
2^{2009}<\left(2^{9}\right)^{224}<\left(10^{3}\right)^{224}=10^{672}
$$

Thus, $2^{2009}$ has fewer than 672 digits, and therefore,

$$
\begin{aligned}
s\left(2^{2009}\right) & <9 \times 672=6048 \\
s\left(s\left(2^{2009}\right)\right) & \leq 5+9+9+9=32 \\
s\left(s\left(s\left(2^{2009}\right)\right)\right) & \leq 2+9=13
\end{aligned}
$$

Since the only number less than or equal to 13 that leaves a remainder of 5 when divided by 9 is 5, we have that $s(s(s(2^{2009})))=5$.