Home / Riddles / Math riddles / If you write every whole number from 1 to 100 · Riddle
Math riddles
If you write every whole number from 1 to 100, how many times do you write the digit 9?
A counting puzzle where most people stop at ten. The trap is a number that holds the digit twice.
If you write every whole number from 1 to 100, how many times do you write the digit 9?
Hint: Count the 9s in the ones place and the 9s in the tens place separately.
Reveal the answer
20
Nine appears ten times in the ones place (9, 19 … 99) and ten times in the tens place (90 to 99), twenty in all.
How to solve it (spoilers)
How to think about it
- Count the 9s in the ones place: 9, 19, 29, 39, 49, 59, 69, 79, 89 and 99. That is ten.
- Count the 9s in the tens place: 90, 91, 92 and so on up to 99. That is ten more.
- Notice that 99 appears in both lists. That is correct, because it really has two 9s.
- Add the two counts: 10 + 10 = 20. The number 100 adds none.
Why “20” is the answer
The question asks how many times the digit is written, not how many numbers contain it. Nineteen numbers between 1 and 100 contain a 9, but 99 contains two, so you write the digit 20 times. Splitting the count by place value avoids both missing and double counting.
Common wrong answers
- 10. That only counts the ones place and misses 90 to 98, which have a 9 in the tens place.
- 19. That is how many numbers contain a 9. The number 99 has two of them, so the digit is written 20 times.
Related riddles
- I am a two-digit number. My digits add up to 9, and if you swap them, the new number is 27 more than me. What number am I?
- What is the smallest whole number greater than 1 that leaves a remainder of 1 when you divide it by 2, by 3, by 4, by 5 and by 6?
- I am an odd number. Take away one letter and I become even. What number am I?
- Which three positive whole numbers give the same result when added together as when multiplied together?
- In one full day of 24 hours, how many times do the hour hand and the minute hand of a clock point in exactly the same direction?
Want a fresh one tomorrow? Try the riddle of the day, or the riddle of the week.