AMC 10 · 2010 · #24

Grade 8 number-theory
legendre-formulachinese-remainder-theoremeulers-theoremmodular-arithmeticfactorial identify-subproblems ↑ Prerequisites: modular-arithmetic
📏 Long solution 💡 4 insights
Problem
Write out 90! (the product 1 · 2 · 3… 90). It ends in a run of zeros. Ignore those trailing zeros and read the two digits just before them. Those two digits form a number n; find n.

Pick an answer.

(A)
12
(B)
32
(C)
48
(D)
52
(E)
68

AMC 10 2010 problem © Mathematical Association of America (MAA AMC). Reproduced for educational use.

How to solve
Strategy Solve an Easier Related Problem

Tool #9 (Solve an Easier Related Problem): the full number 90! is impossible to compute, so replace it with a much smaller question about remainders. The last two nonzero digits are N mod 100, where N is 90! with its trailing zeros removed. Tool #7 (Identify Subproblems): 100 = 4 × 25 with 4 and 25 sharing no factors, so split the one hard remainder into an easy N mod 4 and a harder N mod 25, then reassemble. Tool #5 (Look for a Pattern): mod 25, each clean block of 25 consecutive numbers leaves the same footprint, and the powers of 2 repeat in a short cycle — patterns that collapse the huge product to a few small steps.

1STEP 1

Count and strip the trailing zeros

Factors of 5 are scarcer than 2s, so the zero count is ⌊90/5⌋+⌊90/25⌋ = 21. Strip them off: N = 90!/10²¹, and we want N mod 100.

⌊ 90/5 ⌋ + ⌊ 90/25 ⌋ = 18 + 3 = 21, N = 90!/10²¹
2STEP 2

Split the target into a 4-clock and a 25-clock

Since 100 = 4 × 25 with no shared factor, do mod 4 and mod 25 apart. 90! has 86 twos and only 21 leave with the zeros, so N ≡ 0 (mod 4).

100 = 4 · 25, gcd(4,25)=1; #twos = 86, 86-21 = 65 ≥ 2 → N ≡ 0 (mod 4)
3STEP 3

Strip the fives block by block, mod 25

In each run of 25, the numbers coprime to 5 multiply to -1 (mod 25). There are four such runs here, so together they give (-1)⁴ ≡ 1.

(1 · 2 · 3 · 4)(6 · 7 · 8 · 9)(11 · 12 · 13 · 14) ≡ (-1)(-1)(-1) ≡ -1; (-1)⁴ ≡ 1 (mod 25)
4STEP 4

Peel the fives off the multiples of 5

Peel one 5 off each of 5 · 1…5 · 18, then one more off 5,10,15 inside 18!. What survives is 4 and 6, so A ≡ 4 · 6 = 24 ≡ -1 (mod 25).

1 · 2… 18 (drop mult. of 5)≡ 4 · 1 · 2 · 3= 6 · 1_Step 3 = 24 ≡ -1 (mod 25)
5STEP 5

Divide out the 2s using cycling powers

N = A/2²¹ and 2¹⁰ ≡ -1 makes 2²¹ ≡ 2 (mod 25), whose inverse is 13, so N ≡ (-1) · 13 ≡ 12 (mod 25).

2¹⁰ ≡ -1, 2²¹ ≡ 2, 2⁻¹ ≡ 13 (mod 25); N ≡ (-1) · 13 ≡ 12 (mod 25)
6STEP 6

Glue the two clocks together

Below 100 only one value is both ≡ 0 (mod 4) and ≡ 12 (mod 25), so n = 12, choice (A).

N ≡ 0 (mod 4), N ≡ 12 (mod 25) → N ≡ 12 (mod 100); n = 12 (A)
Answer
12
The two checks are independent, so passing both is strong evidence. Mod 4: 12 is a multiple of 4, matching N ≡ 0. Mod 25: retracing, A ≡ -1 and dividing by 2²¹≡ 2 gives -1 · 13 = -13 ≡ 12. Every answer choice (12,32,48,52,68) is a multiple of 4, which fits our mod 4 result — so the mod 25 step is what actually selects the answer, and only 12 satisfies ≡ 12 (mod 25) among them (32≡ 7, 48≡ 23, 52≡ 2, 68≡ 18). That single match confirms (A).
💡Key takeaway

To find the last nonzero digits of a huge factorial, strip the zeros, then track the number on a 4-clock and a 25-clock and glue the two readings back together.

  • Count and strip the trailing zeros
  • Split the target into a 4-clock and a 25-clock
  • Strip the fives block by block, mod 25
  • Peel the fives off the multiples of 5
  • Divide out the 2s using cycling powers
  • Glue the two clocks together