DR.WANG Mathematics中文

2025 AIME I · Question 10

Counting & combinatorics · arrangements with restrictions · multiplication principle · prime factorization · number-theory

Problem outline

Count the fillings of a 3×93\times9 strip with digits 11–99 in which each row and each of the three disjoint 3×33\times3 boxes contains all nine digits. For the resulting count N=∏pepN=\prod p^{e_p}, evaluate ∑pep\sum pe_p.

Show answer and methods 2 methods

Answer

081

Method 1 Assign a cyclic direction to every digit

The left box can be filled in 9!9! ways. Fix such a filling and label its three rows cyclically 0,1,20,1,2. The next copy of a digit in the middle box must move from its old row ii to either i+1i+1 or i−1i-1 modulo 33.

Write fif_i for how many of the three digits from row ii move forward. The new population of row ii equals fi−1+3−fi+1f_{i-1}+3-f_{i+1}, which must be 33. This forces all fif_i to have a common value ff.

For each of the three source rows choose which ff digits move forward. Summing gives ∑f=03(3f)3=1+27+27+1=56\sum_{f=0}^3\binom3f^3=1+27+27+1=56 middle-box assignments to rows. Each digit goes in its one unused row in the right box; that row receives exactly the three digits missing from its first six cells.

Each of the six three-cell row segments in the last two boxes admits 3!3! orders. Hence N=9!⋅56⋅66=2163105172N=9!\cdot56\cdot6^6=2^{16}3^{10}5^1 7^2. The requested weighted sum is 2(16)+3(10)+5+7(2)=812(16)+3(10)+5+7(2)=81.

Method 2 Classify the six possible paths of a digit

Record for each digit the rows it occupies in the three boxes from left to right. The record must be a permutation of 123123. Split the six records into the cyclic triples 123,231,312123,231,312 and their reversals 321,132,213321,132,213. Once all records are assigned, each of the nine box–row segments can be internally ordered in 3!3! ways.

Let the counts for 123,231,312123,231,312 be a,b,ca,b,c. In the first box row 11 uses only records 123,132123,132, so the count for 132132 is 3−a3-a. In the second box row 33 uses only 231,132231,132, so b=ab=a. In the third box row 22 uses only 312,132312,132, so c=ac=a. Applying the same three-per-cell condition to the other first-box rows makes the counts of 321321 and 213213 also 3−a3-a.

Conversely these counts satisfy every three-per-cell condition. For fixed aa, assign nine labelled digits to these six record types in 9!/(a!3(3−a)!3)9!/(a!^3(3-a)!^3) ways. Multiplying by 696^9 and summing over a=0,1,2,3a=0,1,2,3 yields 9!⋅66(1+27+27+1)9!\cdot6^6(1+27+27+1). Its prime powers 21631051722^{16}3^{10}5^1 7^2 give 8181.

Source and attribution

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

Original question (external)