## Task A-1.4.

Determine the smallest natural number whose sum of digits is divisible by 7 and has the property that the sum of the digits of its successor is also divisible by 7.
## Solution.

Let $n$ be the desired natural number. Assume that $n$ ends with $k$ digits 9, and let $A$ be the number obtained by deleting those $k$ digits 9.

The numbers $k$ and $A$ are non-negative integers, not both zero. The number $A$ does not end with the digit 9. Let $s_{A}$ be the sum of the digits of the number $A$.

The sum of the digits of the number $n$ is $s_{A} + 9k$.

Its successor ends with exactly $k$ zeros, and the number $A+1$ is written before those zeros. Therefore, the sum of the digits of the successor is $s_{A} + 1$.

For the number $s_{A} + 1$ to be divisible by 7, the smallest value for $A$ is 6.

For the number $s_{A} + 9k = 6 + 9k$ to be divisible by 7, the smallest value for $k$ is 4.

Therefore, the smallest natural number $n$ with the desired property is 69999.