2004 AIME II Problem 4

Attempt Problem 4 of the 2004 AIME II below, then check your answer against the professionally curated solution from LIVE by Po-Shen Loh. You can also try the full timed exam, view all 2004 AIME II solutions, or check the answer key.

All problems are used with official legal permission of the Mathematical Association of America (MAA).

4.

How many positive integers less than 10,00010{,}000 have at most two different digits?

Answer: 927
Concepts:digitscaseworkmultiplication principle
Difficulty rating: 2300
Solution:

All 9999 positive integers below 100100 qualify. A qualifying 33-digit number is either a repdigit (99 of them) or uses a leading digit a1a \ge 1 together with a second value bab \ne a in some of the last two positions: 221=32^2 - 1 = 3 patterns, each realized in 999 \cdot 9 ways (99 choices for a,a, then 99 for bb), for 9+381=2529 + 3 \cdot 81 = 252 numbers.

Similarly a qualifying 44-digit number is a repdigit (99) or has bab \ne a appearing in a nonempty subset of the last three positions: 231=72^3 - 1 = 7 patterns, each in 999 \cdot 9 ways, for 9+781=5769 + 7 \cdot 81 = 576 numbers.

The total is 99+252+576=927.99 + 252 + 576 = 927.

← Problem 3#3
Full Exam

Problem 4 in Other Years