A Carmichael number is a composite integer $n$ that satisfies the modular arithmetic congruence relation $b^{n-1} \equiv 1 \pmod{n}$ for all integers $b$ that are relatively prime to $n$. They are named after the American mathematician Robert Daniel Carmichael.
Definition Formally, a positive composite integer $n$ is a Carmichael number if and only if for every integer $b$ coprime to $n$ (i.e., $\gcd(b, n) = 1$), the following congruence holds: $$b^{n-1} \equiv 1 \pmod{n}$$
Korselt's Criterion (1899) A theorem by Alwin Korselt provides an equivalent characterization that does not reference the base $b$. A positive composite integer $n$ is a Carmichael number if and only if:
- $n$ is square-free (no prime factor appears more than once).
- For every prime $p$ dividing $n$, $p-1$ divides $n-1$.
Properties
- Fermat Pseudoprimes: Carmichael numbers are Fermat pseudoprimes to every base coprime to them. This makes them "absolute" Fermat pseudoprimes. Consequently, the Fermat primality test cannot distinguish Carmichael numbers from primes.
- Odd and Square-free: By Korselt's criterion, all Carmichael numbers are odd and square-free.
- Number of Prime Factors: A Carmichael number must have at least three distinct prime factors. The smallest Carmichael number is $561 = 3 \times 11 \times 17$.
- Infinitude: In 1994, William Alford, Andrew Granville, and Carl Pomerance proved that there are infinitely many Carmichael numbers.
Examples The first few Carmichael numbers are:
- $561 = 3 \times 11 \times 17$
- $1105 = 5 \times 13 \times 17$
- $1729 = 7 \times 13 \times 19$ (Also known as the Hardy–Ramanujan number)
- $2465 = 5 \times 17 \times 29$
- $2821 = 7 \times 13 \times 31$
- $6601 = 7 \times 13 \times 73$
- $8911 = 7 \times 19 \times 67$
History The concept was first studied by Václav Šimerka in 1885, who listed the first seven Carmichael numbers. However, they are named after Robert Carmichael, who independently found the first example (561) in 1910 and studied their properties. The term "Carmichael number" was introduced by Nicolaas Govert de Bruijn in 1952.
Significance in Cryptography The existence of Carmichael numbers demonstrates the flaw in using the Fermat primality test as a deterministic primality proof. While probabilistic tests like the Miller–Rabin test can detect Carmichael numbers (as they are not strong pseudoprimes to all bases), their existence necessitates the use of more robust primality proving algorithms (such as AKS or ECPP) or careful implementation of probabilistic tests in cryptographic applications.