Show that for every positive integer n, the total number of digits in the sequence 1,2,3,...,10^n is equal to the number of zero digits in the sequence 1,2,3,...,10^(n+1).
Let's find the first number first.
There are 9 1digit numbers.
There are 90 2digit numbers, 10  99, for 2*9*10^1 digits.
At any given number of digits, k, there are k*9*10^(k1) digits. This holds true through k = n.
There is one (n+1)digit number.
The total is 9 + 2*90 + ... + n*9*10^(n1) + n + 1.
Now the second number to see if it's equal to the first:
There are no zeros among the 1digit numbers.
Among the 2digit numbers, there are 9 zeros.
Among kdigit numbers, in any given position except the first, a zero will occur 9*10^(k2), the factor of 9 referring to the 9 possibilities for the first digit and the 10^(k2) referring to the 10 possibilities in each of the remaining positions (other than the first and the one whose zeros you're considering). So for each of the k1 positions a zero could occur, it will occur 9*10^(k2) times. That adds up to (k1)*9*10^(k2).
This time we are going up to all the (n+1)digit numbers plus one (n+2)digit number. But that (n+2)digit number has n+1 zeros, so we get
0 + 9 + 2*9*10^1 + ... + (n+11)*9*10^(n+12) + n + 1.
This simplifies to the same number as the first.

Posted by Charlie
on 20050225 14:25:24 