Wilson's Theorem

Home > Mathematics > Number theory > Congruence > Wilson's Theorem

This theorem states that a positive integer p is prime if and only if (p-1)! ≡ -1 mod p. It is useful in checking primality of large numbers.