Problem

Source: Lusophon 2018 CPLP P3

Tags: number theory, sum of digits, minimum



For each positive integer $n$, let $S(n)$ be the sum of the digits of $n$. Determines the smallest positive integer $a$ such that there are infinite positive integers $n$ for which you have $S (n) -S (n + a) = 2018$.