Subject 2. Let the natural number $n=\overline{11 \ldots 1}+\overline{22 \ldots 2}+\ldots \ldots+\overline{88 \ldots 8}+\overline{99 \ldots 9}$, where each number of the form $\overline{a a \ldots a}$ contains 2015 digits of $a$. Determine how many digits of 9 the number $n$ contains.
## Solution:

$n=1 \cdot \overline{11 \ldots 1}+2 \cdot \overline{11 \ldots 1}+3 \cdot \overline{11 \ldots 1}+\ldots .+8 \cdot \overline{11 \ldots 1}+9 \cdot \overline{11 \ldots 1}$

$=(1+2+3+\ldots \ldots+8+9) \cdot \overline{11 \ldots 1}=45 \cdot \overline{11 \ldots 1}$.

We obtain $n=\overline{499 \ldots 95}$, a number that has 2016 digits. Therefore, $n$ contains 2014 nines.

| Details of solution | Associated grading |
| :---: | :---: |
| $(1+2+3+\ldots+8+9) \cdot \overline{11 \ldots 1}=45 \cdot \overline{11 \ldots 1}$ | $3 \mathrm{p}$ |
| Obtain that $n=\overline{499 \ldots 95}$ | $2 \mathrm{p}$ |
| Specify that the number $n$ has 2016 digits, from which it is deduced that $n$ | $2 \mathrm{p}$ |