🦘 Math Kangaroo Grade All Felix 1-2 Ecolier 3-4 Benjamin 5-6 Kadett 7-8 Junior 9-10 Student 11-12 ⇄ switch contest
2024 Math Kangaroo

Problem 11

Problem 11 · 2024 Math Kangaroo Stretch
Number Theory digit-sumcareful-counting

The rooms in a hotel are numbered in ascending order (No. 1, 2, 3, …), with no number left out. Beaver Benji counts the digits of all the room numbers and finds the digit ‘2’ fourteen times and the digit ‘5’ three times. What is the biggest possible room number in this hotel?

Show answer
Answer: C — 34
Show hints
Hint 1 of 2
Count how often each digit shows up as you list the room numbers 1, 2, 3, … and watch the running totals for the digit 2 and the digit 5.
Still stuck? Show hint 2 →
Hint 2 of 2
Three 5s are used up exactly at room 25 (from 5, 15, 25), so the hotel can't reach 35; check that fourteen 2s also work out by then.
Show solution
Approach: track the running count of the digits 2 and 5
  1. List room numbers in order and tally the digit 5: it appears in 5, 15, 25, … so the third 5 occurs at room 25 and a fourth would appear at 35.
  2. Since only three 5s are used, the hotel cannot include 35, so the largest possible number is below 35.
  3. Now tally the digit 2 up to 34: units-place 2s in 2, 12, 22, 32 give 4, and tens-place 2s in 20–29 give 10, totalling exactly 14.
  4. Both counts match at room 34, so that is the biggest possible room number.
Mark: · log in to save