DR.WANG Mathematics中文

2025 AIME I · Question 5

Number theory · divisibility · permutations · casework · counting · problem-solving

Problem outline

Let NN count arrangements of the eight different digits 11 through 88 that form a multiple of 2222. How far is NN from 20252025?

Show answer and methods 2 methods

Answer

279

Method 1 Pair multiples of eleven by changing every digit

Let ss be the sum at the four odd positions. The total digit sum is 3636, so the alternating sum is 2s−362s-36. Since 10≤s≤2610\le s\le26, this is an even number in [−16,16][-16,16]. Its only possible multiple of 1111 is 00, hence s=18s=18.

When a sum-1818 four-digit set contains 88, the remaining three digits must total 1010. The possibilities are (1,2,7),(1,3,6),(1,4,5),(2,3,5)(1,2,7),(1,3,6),(1,4,5),(2,3,5). Taking the four complements supplies all sets without 88. Thus 8(4!)2=46088(4!)^2=4608 arrangements are divisible by 1111.

Replacing every digit dd by 9−d9-d preserves the digit set and changes the sign of the alternating sum. The last digit changes parity, and doing the replacement twice returns to the original arrangement. Exactly one arrangement per pair is even, so N=4608/2=2304N=4608/2=2304 and N−2025=279N-2025=279.

Method 2 Place the units digit inside a balanced four-digit set

Divisibility by 1111 forces each group of four alternating positions to sum to 1818: the alternating difference is even and has magnitude at most 26−10=1626-10=16. A group summing to 1818 needs two odd and two even digits. Four odd digits would total 1616 and four even digits would total 2020.

Choose the two odd digits for the even-numbered positions. Their sum can be 4,6,8,10,124,6,8,10,12 with multiplicities 1,1,2,1,11,1,2,1,1. To make 1818, the two even digits must respectively sum to 14,12,10,8,614,12,10,8,6 with multiplicities 1,1,2,1,11,1,2,1,1. This gives 1+1+4+1+1=81+1+4+1+1=8 eligible four-digit sets.

The units position belongs to the even-numbered positions. For each set, choose one of its two even digits to go last, permute the remaining three digits in these positions, and permute the four digits in the odd positions. Hence N=8⋅2⋅3!⋅4!=2304N=8\cdot2\cdot3!\cdot4!=2304, giving difference 279279.

Source and attribution

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

Original question (external)