Problem:
Given a positive integer n, let p(n) be the product of the non-zero digits of n. (If n has only one digit, then p(n) is equal to that digit.) Let
S=p(1)+p(2)+p(3)+β―+p(999)
What is the largest prime factor of S?
Solution:
Consider each positive integer less than 1000 to be a three-digit number by prefixing 0's to numbers with fewer than three digits. The sum of the products of the digits of all such positive numbers is
(0β
0β
0+β0β
0β
1+0β
0β
2+β―+9β
9β
8+9β
9β
9)β0β
0β
0=(0+1+2+β―+9)3β0β(*)
However, p(n) is the product of the non-zero digits of n. The sum of these products can be found by replacing 0 by 1 in the above expression, since ignoring 0's is equivalent to thinking of them as 1's in the products. (Note that the final 0 in (β) becomes a 1 and compensates for the contribution of 000 after it is changed to 111.) Hence
n=1β999βp(n)=(1+1+2+β―+9)3β1=463β1=(46β1)(462+46+1)=33β
5β
7β
103
and the largest prime factor is 103β.
The problems on this page are the property of the MAA's American Mathematics Competitions