Wilson's theorem - Wikipedia
https://en.wikipedia.org/wiki/Wilson's_theoremIn number theory, Wilson's theorem states that a natural number n > 1 is a prime number if and only if the product of all the positive integers less than n is one less than a multiple of n. That is (using the notations of modular arithmetic), the factorial satisfies exactly when n is a prime number. In other words, any number n is a prime number if, and only if, (n − 1)! + 1 is divisible by n.
Wilson's Theorem -- from Wolfram MathWorld
mathworld.wolfram.com › WilsonsTheoremDec 17, 2021 · Wilson's Theorem. Iff is a prime , then is a multiple of , that is. (1) This theorem was proposed by John Wilson and published by Waring (1770), although it was previously known to Leibniz. It was proved by Lagrange in 1773. Unlike Fermat's little theorem, Wilson's theorem is both necessary and sufficient for primality.
Wilson's Theorem - GeeksforGeeks
https://www.geeksforgeeks.org/wilsons-theorem15.12.2015 · Last Updated : 19 Nov, 2016. Wilson’s theorem states that a natural number p > 1 is a prime number if and only if. (p - 1) ! ≡ -1 mod p OR (p - 1) ! ≡ (p-1) mod p. Examples: Attention reader! Don’t stop learning now. Get hold of all the important DSA concepts with the DSA Self Paced Course at a student-friendly price and become industry ...