Solution
Counting the Zeros
Show the problem again
All the integers from 1 to 1000 are written in ordinary decimal notation (no leading zeros). How many times is the digit 0 written in total? Give an integer.
Worked solution
The answer is 192. One-digit numbers contain no zeros. Two-digit numbers 10 to 99 have a zero only in the units place: 9 numbers (10, 20, ..., 90), 9 zeros. Three-digit numbers 100 to 999: the tens digit is 0 in 9 × 10 = 90 numbers and the units digit is 0 in 9 × 10 = 90 numbers, giving 180 zeros. Finally 1000 contributes 3. Total: 9 + 180 + 3 = 192. The naive "every digit equally often" argument fails here precisely because leading zeros are not written.
Source: Classic exercise in wide circulation; no traceable original source. Statement written for AxiomIQ.