2024 AIME II Problem 7

Below is the professionally curated solution for Problem 7 of the 2024 AIME II, from LIVE by Po-Shen Loh. You can also try the full timed exam, view all 2024 AIME II solutions, or check the answer key.

All of the real AMC 8, AMC 10, AMC 12, and AIME problems in our complete solution collection are used with official legal permission of the Mathematical Association of America (MAA).

Concepts:modular arithmeticdigitsoptimization

Difficulty rating: 2650

7.

Let NN be the greatest four-digit integer with the property that whenever one of its digits is changed to 1,1, the resulting number is divisible by 7.7. Let QQ and RR be the quotient and remainder, respectively, when NN is divided by 1000.1000. Find Q+R.Q + R.

Solution:

Write NN with digits a,b,c,d.a, b, c, d. Changing the thousands digit to 11 produces N(a1)1000,N - (a - 1) \cdot 1000, so N1000(a1)(mod7),N \equiv 1000(a-1) \pmod 7, and similarly for the other digits. Since 10006,1000 \equiv 6, 1002,100 \equiv 2, and 103(mod7),10 \equiv 3 \pmod 7, N6(a1)2(b1)3(c1)d1(mod7).N \equiv 6(a-1) \equiv 2(b-1) \equiv 3(c-1) \equiv d - 1 \pmod 7.

Let k=Nmod7.k = N \bmod 7. Using 616 \equiv -1 and the inverses 214,2^{-1} \equiv 4, 315,3^{-1} \equiv 5, the digits satisfy a1k,a \equiv 1 - k, b1+4k,b \equiv 1 + 4k, c1+5k,c \equiv 1 + 5k, d1+k(mod7).d \equiv 1 + k \pmod 7. But also kN6a+2b+3c+d(mod7);k \equiv N \equiv 6a + 2b + 3c + d \pmod 7; substituting gives k12+18k5+4k,k \equiv 12 + 18k \equiv 5 + 4k, so 3k23k \equiv 2 and k3(mod7).k \equiv 3 \pmod 7.

Then a5,a \equiv 5, b6,b \equiv 6, c2,c \equiv 2, d4(mod7),d \equiv 4 \pmod 7, and taking the largest digit in each class gives a=5a = 5 (the class {5,12,}\{5, 12, \ldots\} has no larger digit), b=6,b = 6, c=9,c = 9, d=4:d = 4: N=5694.N = 5694. Indeed 1694,5194,5614,56911694, 5194, 5614, 5691 are all multiples of 7.7. Finally Q=5,Q = 5, R=694,R = 694, and Q+R=699.Q + R = 699.

← Problem 6Full ExamProblem 8

Problem 7 in Other Years