Let p(n) denote the product of the nonzero digits of n. For example, p(5) = 5, p(37) = 21, and p(604) = 24. Without resorting to a computer, evaluate
p(1) + p(2) + p(3) + ... + p(999999).
(In reply to
solution by Charlie)
I forgot that the numbers with zero in them still count, by ignoring the zero digits, and adding in the product of the rest of the digits. So, for example, 4-digit numbers include those with a single zero, in any of three positions, thus counting 3*45^3, that is three times the value previously (previous comment) calculated for 3-digit numbers; they also include those with two zeros in any of the C(3,2)=3 positions, this time adding in 3*45^2; plus the 45 for the three-zero case.
I have to think about this more, or work out the total.
|
Posted by Charlie
on 2019-08-23 11:11:35 |