If $p$ is prime then $(p-1)! \equiv p-1\pmod{\frac{p(p-1)}{2}} $

173 Views Asked by At

I need to prove this.

If $p$ prime then $(p-1)! \equiv p-1\pmod{\frac{p(p-1)}{2}} $.

I can use Lagrange's Theoremm, Wilson's Theorem and Fermat theorem. Thank you.

1

There are 1 best solutions below

2
On

If $p=2$ then $p(p-1)/2=1$ divides everything. (Trivial case).

If $p$ is odd and $p\geq 3$ then $(p-1)!-(p-1)$ is obviously divisible by $(p-1)/2.$

If $p$ is an odd prime then $(p-1)!-(p-1)$ is divisible by $p$ (Wilson's Theorem). Since $(p-1)!-(p-1)$ is also divisible by $(p-1)/2$, and $\gcd (p,(p-1)/2)=1,$ it must be divisible by $p((p-1)/2).$

(If $a|c$ and $b|c$ and $\gcd (a,b)=1$ then $ab|c.$)