Here's an interesting characterization of primes:
Wilson's Theorem. A number P is prime if and only if
(P1)! + 1 is divisible by P.
Let's check:
(21)!+1 = 2, which is divisible by 2.
(51)!+1 = 25, which is divisible by 5.
(91)!+1 = 40321, which is not divisible by 9
(cast out nines to see this).
Pretty cool!
The Math Behind the Fact:
However it is not really practical to
use this to test if a number is prime, especially
if P is large: just try P=101, and you'll
see what I mean!
There are better primality tests available; you can learn
about some of them in a number theory class. See also
Fermat's Little Theorem.
How to Cite this Page:
Su, Francis E., et al. "Wilson's Theorem."
Math Fun Facts.
<http://www.math.hmc.edu/funfacts>.
