2026 AIME II Problem 4

Attempt Problem 4 of the 2026 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 2026 AIME II solutions, or check the answer key.

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

4.

For each positive integer nn let f(n)f(n) be the value of the base-ten numeral nn viewed in base b,b, where bb is the least integer greater than the greatest digit in n.n. For example, if n=72,n = 72, then b=8,b = 8, and 7272 as a numeral in base 88 equals 78+2=58;7 \cdot 8 + 2 = 58; therefore f(72)=58.f(72) = 58. Find the number of positive integers nn less than 10001000 such that f(n)=n.f(n) = n.

Answer: 279
Concepts:number basedigitscomplementary counting
Difficulty rating: 2300
Solution:

If nn has a single digit d,d, then the numeral dd has value dd in every base, so f(n)=n:f(n) = n: all 99 one-digit numbers work. If nn has digits dk1d1d0d_{k-1} \ldots d_1 d_0 with k2,k \ge 2, then b10b \le 10 always, and if b<10b \lt 10 then f(n)=dibi<di10i=nf(n) = \sum d_i b^i \lt \sum d_i 10^i = n because the leading digit satisfies dk1bk1<dk110k1.d_{k-1} b^{k-1} \lt d_{k-1} 10^{k-1}. So a multi-digit nn satisfies f(n)=nf(n) = n exactly when b=10,b = 10, that is, when some digit of nn equals 9.9.

Two-digit numbers containing a 9:9: the numbers 9090 through 9999 plus 19,29,,89,19, 29, \ldots, 89, for 10+8=18.10 + 8 = 18. Three-digit numbers containing a 9:9: 900899=252,900 - 8 \cdot 9 \cdot 9 = 252, subtracting the numbers with no 99 (leading digit 118,8, others 0088).

The total is 9+18+252=279.9 + 18 + 252 = 279.

← Problem 3#3
Full Exam

Problem 4 in Other Years