AMC 10 · 2010 · #23

Grade 8 number-theory
legendre-formulachinese-remainder-theoremeulers-theoremmodular-arithmeticfactorial identify-subproblems ↑ Prerequisites: modular-arithmetic
📏 Long solution 💡 4 insights
Problem
A huge factorial ends in a run of zeros, and the two digits just before them are wanted. Find those two digits.

Pick an answer.

(A)
12
(B)
32
(C)
48
(D)
52
(E)
68
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

The trailing zeros are 21 in number.

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

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

One hundred splits into two coprime clocks.

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

Plenty of twos remain, so the small clock reads zero.

(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

Grouping in blocks tames the big clock.

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

Cycling powers undo the extra twos.

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

Glue the two clocks together

Gluing the clocks gives 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