So here it goes.
For any integer $p > 1$, if $(p - 1)!$ is congruent to $-1 \pmod p$ then $p$ is prime.
Any help would be appreciated!
So here it goes.
For any integer $p > 1$, if $(p - 1)!$ is congruent to $-1 \pmod p$ then $p$ is prime.
Any help would be appreciated!
This is Wilson's theorem, and it has been proven by many mathematicians (though perhaps not by Wilson himself, I'm not sure). Proofs can be found in Niven & Zuckerman's An Introduction to the Theory of Numbers and Ethan Bolker's Elementary Number Theory to name just two. On the Web I suggest you go to ProofWiki: https://proofwiki.org/wiki/Wilson%27s_Theorem But avoid Wikipedia at all costs or else you'll be led astray.
For composite number $n$ it is obvious that $\equiv 0$ since all divisors of $n$ are strictly smaller than $n$.
If it is prime. Then $\mathbb{F}_p$ is a field and $x=x^{-1}$ if and only if $x=\pm1$. Hence the other elements has different inverses. Therefore $1\cdots(p-1)\equiv=1.(-1)(a_1a_1^{-1})\cdots \equiv -1$
Note that: $-1 \equiv 1$ in modulo $2$.