Find the remainder of $(p-2)!$ module $p$, where $p$ is a prime $\geq 3$

100 Views Asked by At

My attempt: From Wilson's Theorem: For a prime $p$,

$$(p-1)! \equiv (-1) \pmod p$$

Multiplying both sides by $(p-2)$,

$$(p-2)! \equiv -(p-2) \pmod p$$ i.e. $$(p-2)! \equiv 2 \pmod p$$

So the remainder is 2. But the answer is given to be 1. So where am I wrong?

EDIT: after being pointed out where I was wrong in the comment (THANK YOU!), I see:

$$(p-1)(p-2)! \equiv (-1) \pmod p$$ i.e. $$(-1)(p-2)! \equiv (-1) \pmod p$$ i.e. $$(p-2)! \equiv (1) \pmod p$$

So the remainder is 1. Thank you! :)

1

There are 1 best solutions below

2
On BEST ANSWER

As $p-1=p-2+1,(p-2)\cdot (p-1)!\ne (p-2)!$

and in fact $(p-1) \cdot (p-2)!=(p-1)!$

But $p-1\equiv-1\implies(-1)\cdot (p-2)!\equiv-1\implies (p-2)!\equiv1$