The theorem states that for any integer p greater than 1, p is prime if and only if (p-1)! + 1 is divisible by p.
In other words, for any prime number p, if all numbers 1,2,…,p-1 are multiplied and 1 be added to the result, the sum is divisible by p.
As an example, consider the prime number 5. According to this theorem: (5-1)! + 1 = 1x2x3x4 +1 = 25 which is divisible by 5.