Wilson theorem
= Wilson theorem
{c}
{wiki}
For a prime $p$,
$$
(p-1)!\equiv-1\pmod p.
$$
Every nonzero residue other than $1$ and $-1$ pairs with a distinct multiplicative inverse, leaving only $1(-1)$ in the product.
= Wilson theorem
{c}
{wiki}
For a prime $p$,
$$
(p-1)!\equiv-1\pmod p.
$$
Every nonzero residue other than $1$ and $-1$ pairs with a distinct multiplicative inverse, leaving only $1(-1)$ in the product.