AMC 10 Step by Step

Modular Arithmetic

Remainders, congruences, last digits, cyclicity, Chinese-remainder style reasoning

38
primary-topic problems (2.9% of all)
33
more as a secondary topic
Where it appears
9
P1-10
9
P11-15
9
P16-20
11
P21-25

What you need to know

  • What "mod" means. a≡b(modm)a \equiv b \pmod m means aa and bb leave the same remainder when divided by mm; in other words, mm divides a−ba-b. Example: 17≡2(mod5)17 \equiv 2 \pmod 5, since 55 divides 1515.
  • Working with remainders. You can add, subtract, and multiply congruences, swapping any number for its remainder. You may divide both sides by cc only when cc shares no factor with mm. Example: 17⋅23≡2⋅3=6≡1(mod5)17\cdot23 \equiv 2\cdot3 = 6 \equiv 1 \pmod 5. But 6≡16(mod10)6 \equiv 16 \pmod{10} while 3≢8(mod10)3 \not\equiv 8 \pmod{10}: dividing by 22 failed.
  • Units digits cycle. The units digits of a,a2,a3,…a, a^2, a^3, \dots repeat with a cycle length that divides 44. Example: powers of 22 end in 2,4,8,6,…2, 4, 8, 6, \dots; since 2026=4⋅506+22026 = 4\cdot506+2, 220262^{2026} ends in 44.
  • Any modulus. The remainders of ana^n mod mm always start repeating at some point, so once inside the cycle, reduce the exponent by the cycle length. A few powers may come before the cycle starts. Example: mod 1212, powers of 22 go 2,4,8,4,8,…2, 4, 8, 4, 8, \dots; the cycle starts at 222^2.
  • Fermat's Little Theorem. If pp is prime and does not divide aa, then ap−1≡1(modp)a^{p-1} \equiv 1 \pmod p.
  • Squares. A square leaves remainder 00 or 11 when divided by 33 or by 44. Divided by 88, a square leaves 00, 11, or 44, and an odd square always leaves 11. Example: 49=8⋅6+149 = 8\cdot6+1 and 36=8⋅4+436 = 8\cdot4+4.
  • Chinese Remainder Theorem. If gcd⁡(m,n)=1\gcd(m,n) = 1, a number's remainders mod mm and mod nn pin down its remainder mod mnmn. Example: remainder 22 mod 33 and 33 mod 55 means remainder 88 mod 1515.
  • Digit shortcuts. A number and its digit sum agree mod 99. Mod 1111, use the alternating digit sum, starting with ++ on the units digit. Mod 100100, keep the last two digits. Example: 20262026 leaves 11 mod 99 (digit sum 1010), 22 mod 1111 (6−2+0−26-2+0-2), and 2626 mod 100100.

How AMC 10 tests it

  • "What is the units digit (or remainder mod 77) of 32026+…3^{2026}+\ldots?" Find the cycle and reduce the exponent (problems 8–15).
  • Day-of-week or clock problems: count days, reduce mod 77 or 1212, watch leap years.
  • "Find the smallest nn with n≡2(mod3)n \equiv 2 \pmod 3, n≡3(mod5)n \equiv 3 \pmod 5, n≡1(mod7)n \equiv 1 \pmod 7": the Chinese Remainder Theorem, by listing or stepping through multiples (problems 12–20).
  • Showing an equation has no solutions by working mod 33, 44, 88, or 99.
  • Divisibility in disguise, such as "the average was a whole number after each entry," which means the first kk entries add up to a multiple of kk.

Standard approaches

  1. Reduce the base first, find the cycle length of its powers, and reduce the exponent by that length (never by mm).
  2. In sums of factorials or products, every term past some point is ≡0\equiv 0, so only the first few matter. Example: from 5!5! on, factorials end in 00, so 1!+2!+⋯+100!1!+2!+\dots+100! ends in the same digit as 1+2+6+24=331+2+6+24 = 33.
  3. For several congruences, start with the largest modulus and step through its numbers until the others hold. Example: above, n≡1(mod7)n \equiv 1 \pmod 7 gives 1,8,…1, 8, \dots, and 88 already works.
  4. For "no integer solutions," use a modulus where squares or cubes have few remainders. Example: x2+y2x^2+y^2 leaves 00, 11, or 22 mod 44, so it never equals 20272027.
  5. Use negative remainders to make powers easy: 10≡−1(mod11)10 \equiv -1 \pmod{11}, so 102026≡1(mod11)10^{2026} \equiv 1 \pmod{11}.

Worked example

What is the remainder when 32026+20263^{2026} + 2026 is divided by 77?

(A) 00 (B) 11 (C) 33 (D) 44 (E) 66

Step 1: the cycle. Multiply by 33 and keep the remainder mod 77 each time: 31≡33^1 \equiv 3, 32≡23^2 \equiv 2, 33≡63^3 \equiv 6, 34≡43^4 \equiv 4, 35≡53^5 \equiv 5, 36≡13^6 \equiv 1. The pattern 3,2,6,4,5,13, 2, 6, 4, 5, 1 repeats every 66 powers.

Step 2: place 320263^{2026}. 2026=6⋅337+42026 = 6\cdot337+4, so 32026≡34≡4(mod7)3^{2026} \equiv 3^4 \equiv 4 \pmod 7.

Step 3: add. 2026=7⋅289+32026 = 7\cdot289+3, so 2026≡32026 \equiv 3. Then 32026+2026≡4+3=7≡0(mod7)3^{2026}+2026 \equiv 4+3 = 7 \equiv 0 \pmod 7.

The answer is (A) 0\boxed{\textbf{(A)}\ 0}.

Pitfalls

  • Reducing the exponent by mm instead of the cycle length. Example: using 2026≡3(mod7)2026 \equiv 3 \pmod 7 gives 33≡63^3 \equiv 6, which is wrong.
  • Misplacing remainder 00: it means the end of the cycle. Example: 2028=6⋅3382028 = 6\cdot338, so 320283^{2028} is the 66th entry, 11, not the first entry, 33. Likewise 220282^{2028} ends in 66, the last of 2,4,8,62, 4, 8, 6, not in 20=12^0 = 1.
  • Dividing both sides by a number that shares a factor with the modulus (see the 6≡166 \equiv 16 example above).
  • Off-by-one errors in calendar problems: counting the starting day, or February in leap years. Example: 1010 days after a Monday is a Thursday (10=7+310 = 7+3), not a Wednesday.

Traps that recur

  • Assuming the bits repeat 111 or 011 from the first few (x₀ = x₁ = x₂ = 1) without computing far enough to see the period-3 pattern 0,1,1. (2022 AMC 10B #25)
  • Reducing 90! mod 100 directly (it is 0) or forgetting that removing 21 factors of 5 also requires removing exactly 21 factors of 2. (2010 AMC 10A #24)
  • Assuming powers spread out over many residues (answering 25 or 125) instead of testing whether 100 is a multiple of the order of every unit mod 125. (2024 AMC 10B #18)
  • Testing only whether each fraction is an integer separately; for odd m none of them is, yet the fractional parts 1/2 + 1/4 + 1/8 + 1/8 add up to exactly 1. (2024 AMC 10B #24)

Problems, easiest first

Open any of them to try it here; the worked solution is on the problem's own page.

Page 1 of 2Next →