# proof of Wilson’s theorem result

set of primes We denote by $\mathbb{P}$ the set of primes and by $\overline{x}$ the multiplicative inverse of $x$ in $\mathbb{Z}_{p}$.

###### Theorem (Generalisation of Wilson’s Theorem).

For all integers $1\leq k\leq p-1,\;p\in\mathbb{P}\Leftrightarrow(p-k)!(k-1)!\equiv(-1)^{k}\pmod% {p}$

###### Proof.

If $p$ is a prime, then:

 $\displaystyle(p-k)!\equiv(p-1)!\overline{(p-1)}\cdots\overline{(p-k+1)}\equiv(% p-1)!\overline{(-1)}\cdots\overline{(1-k)}=\\ \displaystyle=(p-1)!(-1)^{k-1}\overline{(k-1)!}\pmod{p},$

and since $(p-1)!\equiv-1\pmod{p}$ (Wilson’s Theorem, simply pair up each number — except $p-1$ and $1$, the only numbers in $\mathbb{Z}_{p}$ which are their own inverses — with its inverse), the first implication follows.

Now, if $p\!\mid\!(p-1)!(k-1)!-(-1)^{k}$, then $p\in\mathbb{P}$ as the opposite would mean that $p=ab$, for some integers $1, and so $p$ would not be relatively prime to $(p-1)!(k-1)!$ as the initial hypothesis implies. ∎

Title proof of Wilson’s theorem result ProofOfWilsonsTheoremResult 2013-03-22 15:07:08 2013-03-22 15:07:08 CWoo (3771) CWoo (3771) 15 CWoo (3771) Proof msc 11-00