DR.WANG Mathematics中文

2025 AIME I · Question 15

Number theory · modular arithmetic · perfect power · recursive counting · counting

Problem outline

Count ordered triples (a,b,c)(a,b,c) from 11 through 729729 for which a3+b3+c3a^3+b^3+c^3 is divisible by 21872187. Report the last three digits of the count.

Show answer and methods 1 methods

Answer

735

Method 1 Classify unit cubes and reduce the modulus

For k≥2k\ge2, cubing the units modulo 3k−13^{k-1} gives exactly once each residue of 11 or −1-1 modulo 9 among the residues modulo 3k3^k. To see this, changing a representative by 3k−13^{k-1} preserves its cube modulo 3k3^k. If r3≡s3(mod3k)r^3\equiv s^3\pmod{3^k} then r≡s(mod3)r\equiv s\pmod3; writing r=s+3tr=s+3t shows r2+rs+s2=3(s2+3st+3t2)r^2+rs+s^2=3(s^2+3st+3t^2) has exactly one factor 3. Thus 3k−1∣r−s3^{k-1}\mid r-s. This proves injectivity and the two finite sets both have size 2⋅3k−22\cdot3^{k-2}; direct reduction modulo 9 gives the stated image.

Only zero or two of the entries can be units: one unit or three signs ±1\pm1 cannot sum to zero modulo 9. For exactly two units, choose the position of the multiple of 3, its value, and one designated remaining unit (use the earlier remaining position). The cube of the last entry is forced and is ±1\pm1 modulo 9, hence has exactly one allowed unit root. With k=7k=7 this yields 3⋅243⋅486=3542943\cdot243\cdot486=354294 triples.

When all entries are divisible by 3, divide them by 3. The new entries run from 1 to 243 and their cube sum must vanish modulo 81=3481=3^4. Cubes modulo 81 depend only on the entries modulo 27, each residue occurring nine times. It suffices to count valid triples from 1 to 27, then multiply by 939^3.

For entries from 1 to 27, the exactly-two-units count is 3⋅9⋅18=4863\cdot9\cdot18=486, applying the same argument with k=4k=4. If all three entries are multiples of 3, divide again: the three quotients run from 1 to 9 and their cube sum must vanish modulo 3. Since t3≡t(mod3)t^3\equiv t\pmod3, any choice of the first two quotients permits exactly three choices for the last. This adds 92⋅3=2439^2\cdot3=243, for a subtotal of 729729.

Combining the two outer cases gives 354294+93⋅729=885735354294+9^3\cdot729=885735, with remainder 735735 modulo 1000.

Source and attribution

The outline and worked methods on this page were prepared for DR.WANG Mathematics.

Original question (external)