Carmichael number Created 2026-09-24 Updated 2026-10-18
A Carmichael number is a composite number for whichEvery unit modulo satisfies the same modular congruence supplied by Fermat's little theorem for a prime number. The name refers to Robert Daniel Carmichael. The coprime qualification is essential: a nonunit can expose a prime factor through a greatest common divisor calculation. A Carmichael number is therefore a Fermat pseudoprime to every coprime base, rather than to every nonzero residue class.[ref]
Carmichael Numbers and Korselt's Criterion by Keith Conrad. Definition 1, printed p. 1: composite input and coprime bases
For example,The factors are distinct prime numbers. Their predecessor numbers all divide , so Korselt criterion applies. More explicitly, for any integer coprime to , Fermat's little theorem givesThe Chinese remainder theorem combines these into . This proves all coprime bases pass from three short divisibility checks, rather than from a long table of sampled bases.
Equivalently, a composite is a Carmichael number exactly when for every integer , including nonunits. The equivalence follows from Korselt criterion: modulo each prime factor, either is zero or its nonzero power returns to one, and squarefreeness combines those congruences. This does not say a nonunit satisfies . For instance gives , while ; the greatest common divisor already supplies the factor three.[ref]
The Carmichael function supplies another compact description: a composite is Carmichael exactly when . For , and . In contrast, Euler's totient function gives , which does not divide . The least common return exponent, rather than the number of units, controls this test.
The obstruction is useful to know when interpreting a Fermat primality test: even checking every coprime base cannot certify primality. The passing-base fraction for the Fermat test makes this failure quantitative. Stronger primality tests require additional structure, such as the squaring conditions in a Miller-Rabin primality test.
The historical record predates the name. Václav Šimerka's 1885 paper lists on printed page 224, together with factorizations. This is an early published list of examples, independently of their later name.[ref]
Zbytky z arithmetické posloupnosti by Václav Šimerka. Zbytky z arithmetické posloupnosti, printed p. 224, §9: list beginning with 561 and 1105; archive title sheet identifies Václav Šimerka and 1885
Past exam of the mathematics course of the University of Cambridge 2004 ia Paper 4 6E Solution Created 2026-09-24 Updated 2026-10-14
For a prime number and an integer coprime to , multiplication by permutes the nonzero residue classes modulo . Indeed, implies , and none of the products is zero. Taking the product over the classes givesThe factorial is coprime to and can be cancelled, proving Fermat little theorem: .
Now and is coprime to , so it is coprime to . Since , the proved theorem givesThus the two specified integer congruences modulo are equivalent. In this particular step the additional hypothesis is not needed; it will hold for the squarefree factorization used next.
If is a squarefree integer, its distinct prime factors are pairwise coprime. Consequently divides exactly when every prime factor does. Applying the preceding equivalence with provesFinally retain this squarefree hypothesis. If divides , write . Fermat little theorem gives for every prime factor. Their pairwise coprimality then gives . For composite this is the sufficient direction of the Korselt criterion for a Carmichael number; primality is not excluded by the requested implication.
Past exam of the mathematics course of the University of Cambridge 2005 ii Paper 4 1H ii Solution Created 2026-09-24 Updated 2026-10-14
The prime factorization is , so it is composite and squarefree. Moreover , and all divide . The Korselt criterion therefore proves that 561 is a Carmichael number.
Past exam of the mathematics course of the University of Cambridge 2005 ii Paper 4 1H i Solution Created 2026-09-24 Updated 2026-10-14
By the Korselt criterion, the prime factors are distinct. There cannot be just one prime factor, since a Carmichael number is composite. If there were exactly two, write with . Then , so , impossible because . Hence at least three distinct prime factors are necessary.
Past exam of the mathematics course of the University of Cambridge 2005 ii Paper 4 1H Solution 2026-10-14
An odd composite integer coprime to is a Fermat pseudoprime to base if . A Carmichael number is a composite integer satisfying this congruence for every integer coprime to . The Korselt criterion says that a composite is a Carmichael number exactly when it is squarefree and divides for every prime divisor of .
Past exam of the mathematics course of the University of Cambridge 2018 ii Paper 4 11G b Solution Created 2026-09-24 Updated 2026-10-03
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 orderBy 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 givesfor 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.
Past exam of the mathematics course of the University of Cambridge 2018 ii Paper 4 11G c Solution Created 2026-09-24 Updated 2026-10-03
The converted source omits from the product; the PDF asks about . Fix the odd prime , and suppose is Carmichael. Its three prime factors are distinct by the Korselt criterion. Relabel so that .
The divisibility conditions includeWritefor a positive integer . Since ,so . Moreover,Multiplying the second divisibility by and reducing modulo givesThe positive integer on the right is at most . ConsequentlyThere are only finitely many possible primes and integers , and each pair determines at most one . Therefore
Past exam of the mathematics course of the University of Cambridge 2026 ii Paper 4 1G Solution Created 2026-09-24 Updated 2026-09-25
A Carmichael number is a composite such that for every coprime to . For , choose by CRT a number whose residue mod is a primitive root; its order divides . If , choose instead a primitive root modulo ; then , impossible because . Thus is square-free. Write . Since , also ; compositeness gives , hence and . This is Korselt criterion.
