1. Determine all natural numbers $n$ for which

$$
n+s(n)=2019
$$

where $s(n)$ denotes the sum of the digits of the number $n$.

(Jaroslav Švrček)
Solution. Let's first try to deduce some estimate of the value of the number $n$ that could satisfy the given equation. On its left side, we have the sum of two natural numbers $n$ and $s(n)$, and therefore both must be less than 2019. More precisely, the value of the sought number $n=2019-s(n)$ will be at most 2018, since $s(n)$ is a natural number. Then we know that the digit sum of the number $n \leqq 2018$ is at most $1+9+9+9=28$, and therefore the number $n$ itself must be somewhere between 2018 and $2019-28=1991$.

Now it is enough to test for which values of $n \in\{2018,2017, \ldots, 1991\}$ the equality $n+s(n)=2019$ holds:

| $n$ | $s(n)$ | $n+s(n)$ |
| :---: | :---: | :---: |
| 2018 | 11 | 2029 |
| 2017 | 10 | 2027 |
| 2016 | 9 | 2025 |
| 2015 | 8 | 2023 |
| 2014 | 7 | 2021 |
| $\mathbf{2 0 1 3}$ | $\mathbf{6}$ | $\mathbf{2 0 1 9}$ |
| 2012 | 5 | 2017 |
| 2011 | 4 | 2015 |
| 2010 | 3 | 2013 |


| $n$ | $s(n)$ | $n+s(n)$ |
| :---: | :---: | :---: |
| 2009 | 11 | 2020 |
| 2008 | 10 | 2018 |
| 2007 | 9 | 2016 |
| 2006 | 8 | 2014 |
| 2005 | 7 | 2012 |
| 2004 | 6 | 2010 |
| 2003 | 5 | 2008 |
| 2002 | 4 | 2006 |
| 2001 | 3 | 2004 |
| 2000 | 2 | 2002 |


| $n$ | $s(n)$ | $n+s(n)$ |
| :---: | :---: | :---: |
| 1999 | 28 | 2027 |
| 1998 | 27 | 2025 |
| 1997 | 26 | 2023 |
| 1996 | 25 | 2021 |
| $\mathbf{1 9 9 5}$ | $\mathbf{2 4}$ | $\mathbf{2 0 1 9}$ |
| 1994 | 23 | 2017 |
| 1993 | 22 | 2015 |
| 1992 | 21 | 2013 |
| 1991 | 20 | 2011 |

Analyzing all 28 possibilities from 1991 to 2018 (or in a similar interval) can be shortened in various ways.

One way is, for example, the observation that if we decrease the number $n$ by one unit and do not cross a ten, the value of the sum $n+s(n)$ decreases by 2 (for example, for $n=2005$ we get $n+s(n)=2012$, for $n=2004$ we get 2010, etc.). Therefore, the sum under consideration has the prescribed value 2019 for at most one $n$ in each ten of natural numbers that differ only in the units place, and we can even determine them from the value of the sum for a single number of this ten, for example, for the one that ends in the digit 9. According to the previous estimates, we will need the values of $n+s(n)$ only for $n$ equal to 2019, 2009, and 1999.

For $n=2019$ we get $n+s(n)=2031=2019+2 \cdot 6$, and therefore among the numbers from 2010 to 2019, only the number $2019-6=2013$ satisfies, which is indeed one of the solutions to the given problem (the check is not necessary due to the observed decrease in the sum by the value of 2).

For $n=2009$ we get $n+s(n)=2020$, which is even, unlike 2019, and so we would look for a solution among the numbers from 2000 to 2009 in vain.

Finally, for $n=1999$ we get $n+s(n)=2027=2019+2 \cdot 4$, and therefore only the number $1999-4=1995$ satisfies, which is the second solution.

Another way to reduce the number of cases to be analyzed is to realize that the number $n$ gives the same remainder as its digit sum $s(n)$ when divided by three. If we denote this remainder as $d$, the number $n+s(n)=2019$ will give the remainder $d+d=2d$ when divided by three. The digit sum of the number 2019 is 12, so the number 2019 is divisible by three, and therefore the remainder of the number $2d$ when divided by three is zero, and thus $d=0$. In other words, the sought number $n$ is
divisible by three. In this case, we would need to check only 9 numbers between 1991 and 2018 that are divisible by three, i.e., 9 possibilities $n \in\{2016,2013, \ldots, 1992\}$.

The previous method of reducing the number of possibilities (using the remainder when divided by three) can be further improved if we realize that we can also use divisibility by nine. It holds that the number $n$ and its digit sum $s(n)$ give the same remainder when divided by nine. Let's denote this remainder as $r$. The number 2019 gives the remainder 3 when divided by nine (i.e., the remainder when dividing the number $2+0+1+9=12$ by nine). From the equation $2019=n+s(n)$, it follows similarly as in the previous paragraph that $n$ gives the remainder 6 when divided by nine, because its double must give the remainder 3. The numbers from 1991 to 2018 that give the remainder 3 when divided by nine are only three, namely $n \in\{2013,2004,1995\}$.

Answer. The problem has two solutions, namely $n=2013$ and $n=1995$.