hosted by the Harvey Mudd College Math Department created, authored and ©1999-2010 by Francis Su

The Math Fun Facts App!

List All : List Recent : List Popular
About Math Fun Facts / How to Use
Contributors / Fun Facts Home
© 1999-2010 by Francis Edward Su

From the Fun Fact files, here is a Fun Fact at the Easy level:

# Wilson's Theorem

Here's an interesting characterization of primes:

Wilson's Theorem. A number P is prime if and only if

(P-1)! + 1 is divisible by P.

Let's check:
(2-1)!+1 = 2, which is divisible by 2.
(5-1)!+1 = 25, which is divisible by 5.
(9-1)!+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.

Su, Francis E., et al. "Wilson's Theorem." Math Fun Facts. <http://www.math.hmc.edu/funfacts>.

Keywords:    number theory, primality test
Subjects:    number theory
Level:    Easy
Fun Fact suggested by:   Jorge Aarao
Suggestions? Use this form.
4.18
current
rating
Click to rate this Fun Fact...
*   Awesome! I totally dig it!
*   Fun enough to tell a friend!
*   Mildly interesting
*   Not really noteworthy
and see the most popular Facts!
New: get the MathFeed iPhone App!

Brings you news and views on math:
showcasing its power, beauty, and humanity

Want another Math Fun Fact?

For more fun, tour the Mathematics Department at Harvey Mudd College!