MenuAll puzzles

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?

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

  1. Count the 9s in the ones place: 9, 19, 29, 39, 49, 59, 69, 79, 89 and 99. That is ten.
  2. Count the 9s in the tens place: 90, 91, 92 and so on up to 99. That is ten more.
  3. Notice that 99 appears in both lists. That is correct, because it really has two 9s.
  4. 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

Want a fresh one tomorrow? Try the riddle of the day, or the riddle of the week.