Image for Wilson's Theorems

Wilson's Theorems

Wilson's Theorem states that a number \( p \) is prime if and only if the factorial of \( p-1 \) (the product of all positive integers less than \( p \)) plus 1 is divisible by \( p \). In formula terms, \[(p-1)! + 1 \equiv 0 \ (\text{mod } p)\] if and only if \( p \) is prime. This theorem provides a way to test whether a number is prime, although it’s often more theoretical than practical for large numbers due to the large factorial calculations involved.