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:

# Fermat's Little Theorem

Fermat's little theorem gives a condition that a prime must satisfy:

Theorem. If P is a prime, then for any integer A,

( AP - A ) must be divisible by P.

Let's check:
29 - 2 = 510, is not divisible by 9, so it cannot be prime.
35 - 3 = 240, is divisible by 5, because 5 is prime.

Presentation Suggestions:
This may be a good time to explain the difference between a necessary and sufficient condition.

The Math Behind the Fact:
This theorem can be used as a way to test if a number is not prime, although it cannot tell you if a number is prime.

Fermat's theorem is a special case of a result known as Euler's theorem: that for any positive integer N, and any integer A relatively prime to N:

( Aphi(N) - A ) must be divisible by N,

where phi(N) is Euler's totient function that returns the number of positive integers less than or equal to N that are relatively prime to N. So when N is prime, phi(N)=N.

Fermat's "little" theorem should not be confused with Fermat's Last Theorem.

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

Keywords:    number theory, primality test
Subjects:    number theory
Level:    Easy
Fun Fact suggested by:   Lesley Ward
Suggestions? Use this form.
4.13
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!
Get the Math Fun Facts
iPhone App!

Want another Math Fun Fact?

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