Skip to main content

2026 AIME II Problem 4

Problem 4 of 15EasierNumber TheoryCombinatoricsArithmetic

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 7⋅8+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.

Your answer

Integer from 0 to 999
Show solution

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 dk−1…d1d0d_{k-1} \ldots d_1 d_0 with k≥2,k \ge 2, then b≤10b \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 dk−1bk−1<dk−110k−1.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: 900−8⋅9⋅9=252,900 - 8 \cdot 9 \cdot 9 = 252, subtracting the numbers with no 99 (leading digit 11–8,8, others 00–88). The total is 9+18+252=279.9 + 18 + 252 = 279.
AoPS wiki

Tagged: number base · digits · complementary counting

More practice