An odd composite coprime to is a Fermat pseudoprime to base when . It is a Carmichael number when this congruence holds for every coprime to .
Suppose a Carmichael number has with . The group is cyclic, so choose a residue of order
By the Chinese remainder theorem, extend it to an integer that is congruent to modulo every other prime-power factor of . Then , and the Carmichael congruence forces the order of modulo to divide . In particular , contradicting . Therefore every Carmichael number is square-free.
Now assume is square-free. If for every , then for every coprime to , Fermat little theorem gives
for each . The Chinese remainder theorem then gives the congruence modulo , so is Carmichael.
Conversely, if is Carmichael, fix . Choose a primitive root modulo and use the Chinese remainder theorem to choose and . Then , so the order of divides . This proves the Korselt criterion in the required form:
A Carmichael number cannot have one prime factor because it is composite. If with distinct primes , the condition implies , which is impossible. Hence every Carmichael number has at least three prime factors.
An odd composite number with is a Fermat pseudoprime to base when
For , the Chinese remainder theorem for unit groups reduces this condition to congruences modulo and . Modulo , Fermat's little theorem gives
so exactly when . Modulo , the unit group has order , so
The equation in the cyclic group has solutions, namely .
Combining the two independent sign choices by the Chinese remainder theorem gives
and hence
is a Fermat pseudoprime to base when it is composite, coprime to , and . Here gives coprimality and , so .
Suppose first that is not primitive modulo . Since it is primitive modulo , its order modulo is then , so
Because divides , the composite number satisfies
it is a Fermat pseudoprime to base and is divisible by . Thus (iii) fails.
Conversely, suppose is primitive modulo and a base- pseudoprime is divisible by with . By part (i),
The pseudoprime congruence forces this order to divide , so in particular . But , a contradiction. Hence no such pseudoprime exists. This proves (i)(iii), and all three statements are equivalent.
The Lagrange root bound over a field says that a nonzero polynomial of degree over a field has at most roots. In particular, a polynomial modular congruence of degree modulo a prime number has at most incongruent solutions unless all its coefficients vanish modulo that prime.
Suppose that is good and that the positive integer divisor divides . The roots of form a finite multiplicative subgroup of . By the fact that every finite multiplicative subgroup of a field is cyclic, is a cyclic group of order . The solutions in of are
so there are at least of them. The Lagrange root bound over a field gives at most roots in all of , hence exactly . Thus every divisor of a good number is good.
Now put . By the Chinese remainder theorem for unit groups, a base is a Fermat-pseudoprime base precisely when its two components satisfy
The power roots in a finite field and
show that each component has ten choices. Therefore there are
Fermat-pseudoprime bases.
To impose the strong pseudoprime condition, write with odd. Since , we have . In each cyclic group of ten Fermat components, raising to the th power sends five elements to and five elements to . A pair of components passes the strong test exactly when their signs agree: the pair satisfies the first alternative, and satisfies the second at . Components of opposite sign become after squaring and can never jointly equal . Hence the number of strong-pseudoprime bases is
For an odd composite and a unit modulo , is a Fermat pseudoprime to base when
It is an Euler pseudoprime to base when
where the right side is the Jacobi symbol.
By the Chinese remainder theorem,
and . The condition is automatic modulo and . Modulo it has
solutions. Thus there are Fermat bases, giving proportion
For the Euler condition, modulo , so the Jacobi symbol must be . The power condition is automatic modulo , while modulo it again restricts to the two solutions of . For each of those two residues, exactly half of the choices modulo and have Jacobi symbol . Hence there are Euler bases and proportion
Let for distinct odd prime numbers with . Exactly unit bases make a Fermat pseudoprime, and exactly of these make it a strong pseudoprime. The Fermat bases form under the Chinese remainder theorem for unit groups. If , then and is odd, so the th-power map sends five elements of each to and five to . The strong condition requires equal signs in both components, giving .