Given a positive integer $n$, let $P(n)$ be the product of the non-zero digits of $n$ (if $n$ is a one digit number, $P(n)$ is $n$ itself). Let $S=P(1)+P(2)+P(3)+\ldots+P(999)$. Then, what is the largest prime factor of $S$?
I could not find the way how to start this problem. Please help me out.
A big hint
Let the sum of your numbers $P(i)$ for $1\le i \le 99$ be $T$.
Then the sum of the $P(i)$ for $101\le i \le 199$ is also $T$.
The sum of the $P(i)$ for $201\le i \le 299$ is $2T$.
...
The sum of the $P(i)$ for $901\le i \le 999$ is $9T$.
The sum of the numbers I've listed is therefore $(1+1+2+...+9)T=46T$.
Find a similar trick to find $T$ easily and you'll soon find the answer. Remember to add in $P(100)$ etc