How to calculate $51! \ mod \ 101$?

1.7k Views Asked by At

I tried almost everything I know Even tried to calculate it from Wilson's theorem and what I got was $$(101-50)! \equiv 51! \equiv (101 + 49!)^{-1} mod \ 101$$

I derived it from $$(p-1)! \equiv -1 \ mod \ p$$ $$(p-2)! \equiv 1 \ mod \ p$$ $$(p-3)! \equiv (p-2)^{-1} \ mod \ p$$ $$(p-4)! \equiv (p+6)^{-1} \ mod \ p$$ and so on...

but calculating right side is as hard as calculating left side and I can't just do it with my pen and paper. Am I going in right direction? I would appreciate some help on this.

4

There are 4 best solutions below

1
On BEST ANSWER

I'll use equality ($=$) through for $\ \equiv \pmod{101}$ - it saves typing.

By Wilson's Theorem, $-1 = 100!$. Recall Wilson's Theorem states that $-1 \equiv (p-1)! \pmod{p}$ for prime $p$.

$$100! = 1 \times 2 \times \dots \times 50 \times \underbrace{51}_{-50} \times \dots \times \underbrace{99}_{-2} \times \underbrace{100}_{-1}$$

That is, $100!$ is $$\underbrace{1 \times 2 \times \dots \times 50}_{50!} \times \underbrace{50 \times 49 \times \dots \times 2 \times 1}_{50!} \times \underbrace{(-1)^{50}}_{1} = (50!)^2$$

Now, $50! \times 51 = 51!$, so

$$\underbrace{51! \times 51^{-1}}_{50!} \times \underbrace{51! \times 51^{-1}}_{50!} = (50!)^2 = 100! = -1$$

so $$(51!)^2 \times 51^{-2} = -1$$

whence

$$(51!)^2 = -51^2$$

Now, we can work out $-51^2$ manually as $25$, so we obtain $(51!)^2 = 25 = 5^2$. Since $x^2 = y^2 \Rightarrow x = \pm y$, we obtain that $51! = \pm 5$.

Now, is it +5 or -5? Still thinking about that one.

0
On

The simplest way is a computer program. In matlab:

x=1;

for n=1:51

x = mod(x*n,101);

end

x

11
On

$100!=1.2.3...50.(-50).(-49)...(-1)\pmod{101}$

8
On

We already know that $100! \equiv -1$ (mod $101$).

Moreover, we have $i \equiv -(101-i)$ (mod $101$), for $1\leq i\leq 50$. Then, one has $50! \equiv (-1)^{50} 51\times 52\times \dots \times 100$, it implies that $50! \equiv 10$ (mod $101$) or $50! \equiv 91$ (mod $101$). But $50! \not\equiv 10$ (mod $101$) (Someone helps me?). So, we get $51! \equiv 91\times 51 \equiv -5$ (mod $101$).