A Carmichael number is a composite \(n\) such that \(b^{n-1} \equiv 1 \pmod{n}\) for every integer \(b\) coprime to \(n\). They are the absolute Fermat pseudoprimes — composites that masquerade as primes for the Fermat primality test against every coprime base.
The smallest Carmichael number is 561 = 3 · 11 · 17. The famous 1729 (the Hardy–Ramanujan taxicab number) is also Carmichael — and is the third smallest.
Korselt's criterion (1899) characterises them: \(n\) is Carmichael if and only if it is squarefree, and for every prime divisor \(p\) of \(n\), \((p - 1)\) divides \((n - 1)\).
Alford, Granville, and Pomerance proved in 1994 that there are infinitely many Carmichael numbers. They are the reason the Fermat primality test alone is unsafe; modern primality tests like Miller–Rabin and Baillie–PSW catch them.