Let $p(n)$ denote the product of decimal digits of a positive integer $n$. Computer the sum $p(1)+p(2)+\ldots+p(2001)$.
Problem
Source: Slovenia National MO 2001 2nd Grade P2
Tags: number theory
08.08.2021 13:33
bump on this
08.08.2021 15:27
Let $n=(d_{l-1}...d_{0})_B$. $n_0=1$ and $n_k = \prod_{i=1}^{k}d_{l-i}$, for $1 \leq k \leq l$. Let $P_B(n)=\prod_{i=0}^{l-1}d_i$, and $S_b(N)=\sum_{i=1}^{n}P_B(i)$. Then $S_b(n)=P_B(n)+\sum_{i=1}^{l-1}\left ( \frac{B(B-1)}{2} \right )^i + \sum_{i=0}^{l-1}n_i \frac{d_{l-1-i}(d_{l-1-i}-1)}{2} \left ( \frac{B(B-1)}{2} \right )^{l-1-i}$ $S_{10}(2001)=184320$
08.08.2021 16:58
The sum of $p(n)$ of all $k$-digit $n$'s equals $(1 + 2 + \dots + 9)^k$. So we have covered the ranges $[1, 9)$, $[10, 99)$ and $[100, 999)$. As for the range $[1000, 2001)$, we only need to consider the values from $1111$ to $1999$. Since the leading digit is fixed to be $1$, it can be seen that the sum of $p(n)$ of all $n$ in this range is $(1 + 2 + \dots + 9)^3$. So the desired sum is \[ 45 + 45^2 + 45^3 + 45^3 = 184320 \]