{{searchResults.length}} {{searchResults.length === 1 ? 'result' : 'results'}} for “{{searchWords}}”No results found for “{{searchWords}}”× back to contents
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)+\cdots+p(999) \] What is the largest prime factor of $S$?
Write each $n$ from $0$ to $999$ with three digits (leading zeros allowed) and replace each $0$ by $1$ in the product. Then $p(n)$ is the product of the three modified digits, and $n=0$ contributes $1$.
Summing over all choices of the three digits, $\sum_{n=0}^{999}p(n)=(1+1+2+\cdots+9)^3=46^3$.
So $S=46^3-1=(46-1)(46^2+46+1)=45\cdot2163=3^3\cdot5\cdot7\cdot103$.
The largest prime factor is $103$. The answer is $\boxed{103}$.
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)+\cdots+p(9999) \] What is the largest prime factor of $S$?