# Primality testing with Fermat's little theorem

If *n* is a prime, and 0 < *b* < *n*, then *b*^{n-1}
is congruent to 1 modulo *n*. So if we compute *b*^{n-1} modulo
*n*, and don't get 1, then we can conclude that *n* is not a prime.

A number *n* is a **pseudoprime to the base** *b* if
*b*^{n-1} is congruent to 1 modulo *n*.
If a number is a pseudoprime to a variety of bases, then it is likely
to be a prime. Below you can find out which composite numbers less than
*m* are pseudoprimes to various bases.

A **Carmichael number** is a composite number *n* such that *b*^{n-1}
is congruent to 1 modulo *n* for every *b* that is relatively prime to *n*. So a
Carmichael number passes the Fermat's-little-theorem test as best as it can.

What are the Carmichael numbers less than *m*?