Modular Arithmetic/Wilson's Theorem

Modular Arithmetic
 ← Lagrange's Theorem Wilson's Theorem Chinese Remainder 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

edit

5 is a prime number because,

 

and

 

which is true. 6, on the other hand, is not, as

 

and

 

which is false.