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$?
← Back to Problem 560