The number of times the digit 3 will be written when listing the integers from 1 to 1000 is
Solution
Core idea. Occurrences of a digit are counted place by place.
Concept refresher. With repetition allowed, free places can be filled from digits in
ways, and non-overlapping cases are added.
Picture the situation. Write the numbers from 0 to 999 as three-place strings from 000 to 999; the extra zeros add no 3s, and the number 1000 contains no 3. The question asks how many times the digit is written, so a number like 333 counts three times. It is easiest to count how often 3 appears in each place.
Approach. Count the appearances of the digit in one place and multiply by the number of places.
Step 1: One place
Fix the digit 3 in one place, say the units place. The other two places can be filled freely in ways, so 3 is written 100 times in that place.
Step 2: All places
The same holds for the tens and the hundreds places, so the digit is written times, and the number 1000 adds none.
Answer. 300
Sanity check. The strings 000 to 999 hold 3000 digits in all, and each of the ten digits appears equally often, so each is written 300 times.
Common wrong answers
- 271: Counting the numbers that contain a 3 gives ; the question counts every time the digit is written.
Key takeaway
The trap. A number such as 333 contributes three occurrences, not one.
How toppers think. They use symmetry: all ten digits share the 3000 written digits equally.
Remember. Each place: 100 times.