TITLE: A positive integer $n$ such that $S(n) = 1996\cdot S(3n)$
QUESTION [9 upvotes]: [Ireland 1996] Find a positive integer $n$ such that $S(n) =
1996\cdot S(3n)$, where $S$ stands for the sum of digits.

The book "104 Number theory problems" gives the following solution:
Consider the number $n=1333....335$, where there are $5986$ $3$'s in between the first and last digit. Then they proceed to explain how this number satisfies the given conditions. That much is clear enough. Here is my query:
What should have instigated us to look at this type of number? The conditions of the problem gives this question a very foreboding appearance. I can't seem to find any motivation for considering such a number.
Some help in understanding the motivation behind the solution will be appreciated.

REPLY [5 votes]: First, as Vadim says, to keep $S(3n)$ small, you can make sure $3n$ contains several zeroes.  Also, since $n\equiv S(n)\pmod9$, we have $1996S(3n)\equiv1996(3n)\equiv3n\pmod9$.  If $S(n)\equiv n\equiv3n\pmod9$, we must have $S(n)\equiv n\equiv0\pmod9$.  So if done right, we can fix $S(3n)$ and add enough filler in the middle to increase $S(n)$.
As possible answers, we have $1$ and $5$ with $5986$ $3$'s in the middle, $2$ and $4$ with $5986$ $3$'s or $4$ and $8$ with $2992$ $6$'s.  In all $3$ of these cases, $S(3n)=9$, so we calculate how much filler is necessary to obtain $S(n)=1996\times9$.