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
Korselt criterion Created 2026-09-24 Updated 2026-10-18
A composite integer is a Carmichael number if and only if it is a squarefree integer andThe criterion is named for Alwin Korselt. The two requirements are different: the first excludes repeated prime factors, while the second makes the exponent a common multiple of the prime-field return exponents.[ref]
For , the numbers divide with quotients . Thus 1105 is another Carmichael number. By contrast is squarefree, but ; a single failed divisor condition excludes it. This illustrates the appeal of the criterion: a statement about every unit becomes a small calculation using a known prime factorization.
The composite condition must be retained. A prime number is squarefree and satisfies the divisibility condition, but is excluded from the definition of a Carmichael number. The resulting certificate also depends on the supplied factors really being prime numbers; merely finding a product decomposition is insufficient.
Proof of Korselt criterion Created 2026-10-14 Updated 2026-10-18
For sufficiency, let be composite and squarefree, with for every prime factor . For any integer coprime to , Fermat's little theorem gives for every such . Their product is , so the Chinese remainder theorem gives the required congruence modulo .
For necessity, first rule out a repeated factor. If with and , the Chinese remainder theorem supplies and . This is coprime to . But the binomial theorem givescontradicting the Carmichael number condition. Hence is squarefree.
Now choose a primitive root modulo a prime factor . Lift it to a unit modulo by prescribing and . The Chinese remainder theorem applies because is squarefree. The Carmichael congruence implies . Since has multiplicative order , that order divides . This proves the other condition.[ref]
Carmichael Numbers and Korselt's Criterion by Keith Conrad. Theorem 2 proof, printed p. 2: repeated prime factors, primitive roots and Chinese remainder lifting
