Math Fun Facts!
hosted by the Harvey Mudd College Math Department created, authored and ©1999-2010 by Francis Su
Subscribe to our RSS feed   or follow us on Twitter.
Get a random Fun Fact!
No subject limitations
Search only in selected subjects
    Calculus or Analysis
    Number Theory
    Other subjects
  Select Difficulty  
Enter keywords 

  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
All rights reserved.

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.

How to Cite this Page:
Su, Francis E., et al. "Wilson's Theorem." Math Fun Facts. <>.

Keywords:    number theory, primality test
Subjects:    number theory
Level:    Easy
Fun Fact suggested by:   Jorge Aarao
Suggestions? Use this form.
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!