2004 AIME II Problem 4

Below is the professionally curated solution for Problem 4 of the 2004 AIME II, 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 of the real AMC 8, AMC 10, AMC 12, and AIME problems in our complete solution collection are used with official legal permission of the Mathematical Association of America (MAA).

Concepts:digitscaseworkmultiplication principle

Difficulty rating: 2300

4.

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

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 3Full ExamProblem 5

Problem 4 in Other Years