[Math] Prove that there exists a number divisible by 1999 with digit sum 1999

divisibilityelementary-number-theory

My nephew in the secondary school asked me how to solve the problem as stated in the title. Honestly, I do not have any idea how to do it:

Prove that there exists a positive integer number such that 1999
divides it, and the sum of all of its digit is also 1999.

Can anybody shed some light on how to solve it?
Any help is much appreciated!

Thanks!

Best Answer

Because $10$ is coprime to $1999$ there exists a positive integer $k$ such that $10^k\equiv1\pmod{1999}$. It follows that $1,10^k,10^{2k},10^{3k},\ldots,$ all leave remainder $1$ when divided by $1999$. Therefore the number

$$ S=1+10^k+10^{2k}+\cdots+10^{1998k} $$ is divisible by $1999$. Furthermore, the decimal expansion of $S$ has $1999$ ones and the rest of its digits are all zeros.