Modular Arithmetic/Wilson's Theorem
Wilson's theorem
A natural number is a prime number, if and only if:
Where denotes the factorial of , meaning the product of all numbers less than or equal to , for every natural number.
Examples
5 is a prime number because,
and
which is true. 6, on the other hand, is not, as
and
which is false.