2. For each natural number $n \geq 2$, consider the natural number $S(n)$ defined by

$$
S(n)=\underbrace{\overline{1 \ldots 1}}_{n \text { times }}+\underbrace{\overline{2 \ldots 2}}_{n \text { times }}+\ldots+\underbrace{\overline{9 \ldots 9}}_{n \text { times }}+10^{n}
$$

a) Calculate $S(3)$.

b) Determine the remainder of the division of $S(n)$ by 3.

c) Let $Q(n)$ be the quotient of the division of $S(n)$ by 3. Find the quotient of the division of the sum of the digits of $Q(n)$ by 9.

Emanuel Munteanu
## Solution.

a) $S(3)=111 \cdot(1+2+\ldots+9)+10^{3}=111 \cdot 45+1000=5995$. (2p)

b) Let $a=\underbrace{\overline{1 \ldots 1}}_{n \text{ times}}$. We have $S(n)=a \cdot(1+2+\ldots+9)+9a+1=54a+1=3 \cdot 18a+1$.

Thus, the remainder of the division of $S(n)$ by 3 is 1. (3p)

c) From b), $Q(n)=18a=18 \cdot \underbrace{\overline{1 \ldots 1}}_{n \text{ times}}=\overline{1 \underbrace{9 \ldots 9}_{n-1 \text{ times }} 8}$. The sum of the digits of $Q(n)$ is then $9n$.

Thus, the quotient in question is $n$. (2p)