Skip to main content

2004 AIME II Problem 4

Problem 4 of 15EasierNumber TheoryCombinatoricsProblem-Solving Techniques

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

Your answer

Integer from 0 to 999
Show solution

Solution

All 9999 positive integers below 100100 qualify. A qualifying 33-digit number is either a number whose digits are all equal (99 of them) or uses a leading digit a≥1a \ge 1 together with a second value b≠ab \ne a in some of the last two positions: 22−1=32^2 - 1 = 3 patterns, each realized in 9⋅99 \cdot 9 ways (99 choices for a,a, then 99 for bb), for 9+3⋅81=2529 + 3 \cdot 81 = 252 numbers. Similarly a qualifying 44-digit number has all its digits equal (99 possibilities) or has b≠ab \ne a appearing in a nonempty subset of the last three positions: 23−1=72^3 - 1 = 7 patterns, each in 9⋅99 \cdot 9 ways, for 9+7⋅81=5769 + 7 \cdot 81 = 576 numbers. The total is 99+252+576=927.99 + 252 + 576 = 927.
AoPS wiki

Tagged: digits · casework · multiplication principle

More practice