MKLab
Wilson's theorem - Printable Version

+- MKLab (https://mklab.gr)
+-- Forum: [INDEX] (https://mklab.gr/forumdisplay.php?fid=1)
+--- Forum: MATHEMATICS (https://mklab.gr/forumdisplay.php?fid=3)
+---- Forum: ARTICLES (https://mklab.gr/forumdisplay.php?fid=13)
+---- Thread: Wilson's theorem (/showthread.php?tid=1391)



Wilson's theorem - mklabgr - 07-28-2026

Wilson's theorem

Summary

Wilson's theorem is a fundamental result in number theory stating that a natural number $n > 1$ is a prime number if and only if the product of all positive integers less than $n$ is one less than a multiple of $n$—expressed in modular arithmetic as $(n-1)! \equiv -1 \pmod n$. 

First stated by Persian mathematician Ibn al-Haytham around 1000 AD and later named after John Wilson (with its first published proof by Joseph-Louis Lagrange in 1771), the theorem provides a theoretical condition for primality, though it is practically useless for testing large prime numbers due to the steep computational complexity of calculating large factorials.

ARTICLE