AMC 10 Step by Step

2010 AMC 10A Problem 24

P21-25~12 minPrint

The number obtained from the last two nonzero digits of 90!90! is equal to nn . What is nn ?

Log in to save your progress.
Show solution without answering

Key insight

Remove the 21 fives and 21 twos that make the zeros, then track only the remainder after dividing by 25. Runs of four non-multiples of 5 act like -1.

Solution

The idea: throw away the tens that make the zeros, then keep track of only a remainder, never the huge number itself.

Step 1: count the zeros. Each zero at the end comes from one 55 paired with one 22. There are far more 22s than 55s, so count the 55s.
- Multiples of 55 up to 9090: 90÷5=1890 \div 5 = 18 of them.
- 2525, 5050, 7575 each give one extra 55: 33 more.

That is 2121 fives, so 90!90! ends in 2121 zeros. Let MM be 90!90! with 2121 fives and 2121 twos taken out. The answer nn is the last two digits of MM.

Step 2: why we only need the remainder after dividing by 25. 90!90! has 8686 twos in total (45+22+11+5+2+145 + 22 + 11 + 5 + 2 + 1, counting multiples of 2,4,8,16,32,642, 4, 8, 16, 32, 64), so MM still has 6565 twos. That makes nn a multiple of 44. All five choices are multiples of 44, so that does not decide it. But the choices leave different remainders when divided by 2525:

Choice12123232484852526868
Remainder after dividing by 25251212772323221818

So we find the remainder of MM after dividing by 2525. Two rules help:
- To find the remainder of a product, you can multiply the remainders instead.
- A remainder of 2424 is "one short of 2525," so it behaves like −1-1: two of them multiply to a remainder of 11.

(Short notation: a≡b(mod25)a \equiv b \pmod{25} means aa and bb leave the same remainder when divided by 2525.)

Step 3: a useful fact. Four numbers in a row with no multiple of 55 multiply to a remainder of 2424, that is −1-1:
- 1⋅2⋅3⋅4=241 \cdot 2 \cdot 3 \cdot 4 = 24.
- 6⋅7⋅8⋅9=3024=25⋅121−16 \cdot 7 \cdot 8 \cdot 9 = 3024 = 25 \cdot 121 - 1.

In general, when you multiply out (5k+1)(5k+2)(5k+3)(5k+4)(5k+1)(5k+2)(5k+3)(5k+4), you get 2424 plus terms that are all multiples of 2525. (The terms with one factor 5k5k add up to 5k⋅(24+12+8+6)=250k5k \cdot (24 + 12 + 8 + 6) = 250k; the others contain 5k5k twice or more.)

Step 4: take the fives out of 90!90!.
- The 7272 numbers from 11 to 9090 that are not multiples of 55 form 1818 groups of four: 11–44, 66–99, …, 8686–8989. Their product acts like (−1)18=1(-1)^{18} = 1.
- The 1818 multiples of 55 are 5⋅1,5⋅2,…,5⋅185 \cdot 1, 5 \cdot 2, \ldots, 5 \cdot 18. Taking out the 1818 fives leaves 1⋅2⋯18=18!1 \cdot 2 \cdots 18 = 18!.

Step 5: do the same inside 18!18!.
- Non-multiples of 55: the groups 11–44, 66–99, 1111–1414 give (−1)3=−1(-1)^3 = -1. The leftovers 16⋅17⋅18=4896=25⋅196−416 \cdot 17 \cdot 18 = 4896 = 25 \cdot 196 - 4 act like −4-4. Together: (−1)(−4)=4(-1)(-4) = 4.
- Multiples of 55: 5,10,155, 10, 15. Taking out the 33 fives leaves 1⋅2⋅3=61 \cdot 2 \cdot 3 = 6.

So 90!90! with all 2121 fives removed leaves remainder 1⋅4⋅6=241 \cdot 4 \cdot 6 = 24, which is −1-1.

Step 6: take out the 21 twos. 210=1024=25⋅41−12^{10} = 1024 = 25 \cdot 41 - 1 acts like −1-1, so 2202^{20} acts like 11 and 2212^{21} acts like 22. We know M×221M \times 2^{21} leaves remainder 2424, so 2×M2 \times M leaves remainder 2424. If MM leaves remainder rr (from 00 to 2424), then 2r2r is 2424 or 4949. It must be even, so 2r=242r = 24 and r=12r = 12.

Step 7: match. Only choice 1212 leaves remainder 1212.

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

Why this works

The last two digits of a number are its remainder after dividing by 100100, and 100=4×25100 = 4 \times 25. The factor 44 is easy because so many 22s are left over, so all the work is with 2525. Removing fives in layers (90!90!, then 18!18!, then 3!3!) and treating each run of four as −1-1 keeps every number small.

Concise solution

A shorter write-up, the way contest solutions are usually written. It may take a different route from the solution above.

The exponent of 55 in 90!90! is ⌊90/5⌋+⌊90/25⌋=18+3=21\lfloor 90/5 \rfloor + \lfloor 90/25 \rfloor = 18 + 3 = 21, and the exponent of 22 is 45+22+11+5+2+1=8645 + 22 + 11 + 5 + 2 + 1 = 86. So 90!90! ends in 2121 zeros and n≡90!1021(mod100)n \equiv \dfrac{90!}{10^{21}} \pmod{100}. This quotient still contains 2652^{65}, so n≡0(mod4)n \equiv 0 \pmod 4; every choice is a multiple of 44, so the work is mod 2525.

A useful fact. For any kk, (5k+1)(5k+2)(5k+3)(5k+4)≡1⋅2⋅3⋅4=24≡−1(mod25)(5k+1)(5k+2)(5k+3)(5k+4) \equiv 1 \cdot 2 \cdot 3 \cdot 4 = 24 \equiv -1 \pmod{25} (the other terms of the expansion are multiples of 2525).

Remove the 5s. Write 90!=518⋅18!⋅P90! = 5^{18} \cdot 18! \cdot P, where PP is the product of the 7272 non-multiples of 55 up to 9090. Those form 1818 blocks of four, so P≡(−1)18=1P \equiv (-1)^{18} = 1. Similarly 18!=53⋅3!⋅Q18! = 5^3 \cdot 3! \cdot Q with Q=(1⋅2⋅3⋅4)(6⋯9)(11⋯14)(16⋅17⋅18)≡(−1)3⋅16⋅17⋅18Q = (1\cdot2\cdot3\cdot4)(6\cdots9)(11\cdots14)(16\cdot17\cdot18) \equiv (-1)^3 \cdot 16 \cdot 17 \cdot 18. Since 16⋅17=272≡−316 \cdot 17 = 272 \equiv -3 and −3⋅18=−54≡−4-3 \cdot 18 = -54 \equiv -4, we get Q≡4Q \equiv 4. Hence
90!521=6⋅Q⋅P≡24≡−1(mod25).\frac{90!}{5^{21}} = 6 \cdot Q \cdot P \equiv 24 \equiv -1 \pmod{25}.

Remove the 2s. 210=1024≡−12^{10} = 1024 \equiv -1, so 221=(210)2⋅2≡2(mod25)2^{21} = (2^{10})^2 \cdot 2 \equiv 2 \pmod{25}. Then n=90!/521221n = \dfrac{90!/5^{21}}{2^{21}} satisfies 2n≡−1≡242n \equiv -1 \equiv 24, so n≡12(mod25)n \equiv 12 \pmod{25}.

Among the choices, 32≡732 \equiv 7, 48≡2348 \equiv 23, 52≡252 \equiv 2, 68≡18(mod25)68 \equiv 18 \pmod{25}; only 1212 works.

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

Review in the AoPS books

Similar problems

Problem © Mathematical Association of America (MAA), American Mathematics Competitions. Reproduced for non-commercial educational use. Solution and commentary are original to this site.