You can view the solution by clicking on the solution tab.
Editorial
Need a hint? Checkout the editorial.
View Editorial
Editorial
- Find how much each digit contributes to $S$.
- Consider each digit's position in the number separately.
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) = n$. Let
$$S = p(1) + p(2) + \cdots + p(999).$$
What is the largest prime factor of $S$?
Source: BdMO 2015 National Secondary P3
There are $3$ digits and each digit has the possible values $\{0,1,2,\dots,9\}$.
Here each digit contributes their values to $S$, except $0$ which contributes $1$. Let $p(0)=1$
Every possible combination of the $3$ digits corresponds to a distinct number in $\{0,1,2,\dots,999\}$ and they cover all the numbers in this set exactly once.
So, $(1+1+2+\dots+9)^3$ is equal to the sum of the products of the numbers' non-zero digits.
$\therefore(1+1+2+\dots+9)^3=p(0)+p(1)+p(2)+\dots+p(999)$
$\implies (1+1+2+\dots+9)^3=p(0)+S$
$\implies S=(1+1+2+\dots+9)^3-1=46^3-1=3^3\cdot5\cdot7\cdot103$
So, $103$ is the largest prime dividing $S$.