Open In App

Wilson's Theorem

Last Updated : 14 Oct, 2024
Comments
Improve
Suggest changes
Like Article
Like
Report

Wilson's Theorem is a fundamental result in number theory that provides a necessary and sufficient condition for determining whether a given number is prime. It states that a natural number p > 1 is a prime number if and only if:

(p - 1)! ≡ −1 (mod p)

This means that the factorial of p - 1 (the product of all integers from 1 to p - 1) is congruent to −1 modulo p. In simpler terms, if you take the factorial of one less than a prime number and divide it by that prime number, the remainder will be p - 1.

Wilson's Theorem Examples

Example for Prime Number

Let’s check for p = 5

Calculate (5 - 1)! = 4! = 24
Check 24 mod  5 = 4 which is indeed -1 mod  5
Thus, 5 is prime.

Example of Composite Number:

For p = 4

Calculate (4 - 1)! = 3! = 6
Check 6 mod  4 = 2 which is not -1 mod  4
Thus, 4 is not prime.

Applications of Wilson's Theorem

While Wilson's Theorem is theoretically significant, its direct application in practical prime number testing is limited due to computational inefficiency. Nonetheless, it serves as a fundamental example of prime number properties in theoretical mathematics and is often referenced in discussions about primality testing.

Read More:


Next Article

Similar Reads