# Find the Remainder when $100!$ is divided by $97^2$?

Find the Remainder when $100!$ is divided by $97^2$?

MyApproach

I applied Wilson Theorem here

$100$.$99$.$98$.$97$.$96!\text{ mod }97^2=100$.$99$.$98$.$96!\text{ mod }97=-970200$

I am getting wrong Ans

Can Anyone guide me how to approach the problem?

First, compute $$a=100\cdot 99\cdot 98\pmod{97},$$ then deduce that $$-a=100\cdot 99\cdot 98\cdot 96!\pmod{97}$$ and that $$-\color{red}{97}a=100!\pmod{97^{\color{red}2}}.$$

• What is wrong in my approach? – justin takro Nov 3 '15 at 6:45
• Your approach says $100\cdot 99\cdot 98\cdot\color{red}{97}\cdot 96!=100\cdot 99\cdot 98\cdot 96!\pmod{97^2}$, or $97x=x\pmod{97^2}$, which is not correct. To see that, take for example $x=1$. – Quang Hoang Nov 3 '15 at 6:53
• I edited the code – justin takro Nov 3 '15 at 10:00
• As I said above, the answer should be $97x$, not $x$. You should multiply $-970200$ by $97$ and that's the answer. – Quang Hoang Nov 3 '15 at 10:21

Facts:

• $97\text{ is prime}$
• $P\text{ is prime}\iff(P-1)!+1\equiv0\pmod{P}$
• The remainder of $100!$ divided by $97^2$ is equivalent to $\frac{100!}{97}\bmod{97}$

Hence: $96!+1\equiv0\pmod{97}$

Hence: $96!\equiv-1\pmod{97}$

Hence: $96!\equiv96\pmod{97}$

Hence: $\frac{100!}{97}\equiv96!\cdot98\cdot99\cdot100\equiv96\cdot98\cdot99\cdot100\equiv93139200\equiv91\pmod{97}$

• $100!$/$97$^$2$(97 raised to power 2)You took 1? – justin takro Nov 3 '15 at 9:58
• @justintakro: No. You asked for the remainder of the quotient of $100!$ and $97^2$, so I calculated the modulo with $97$ of the quotient of $100!$ and $97$, which is the same thing. – barak manos Nov 3 '15 at 10:24

What you did wrong is that you did not finish the calculation:

 -970200 = -970291 + 91 = 97\times(-10003) + 91$The principal remainder is therefore$91\$.