Carmichael Numbers
Statement
A Carmichael number is a composite integer such that for every integer — mimicking Fermat's Little TheoremFermat's Little TheoremFor prime p, a^p is congruent to a mod pRead more → despite not being prime.
Korselt's criterion characterises them: is a Carmichael number if and only if
- is squarefree (no prime square divides ), and
- for every prime .
The smallest Carmichael number is .
Visualization
Verification of Korselt's criterion for the four smallest Carmichael numbers:
| Factorisation | Squarefree? | ? | |
|---|---|---|---|
| 561 | Yes | , , — Yes | |
| 1105 | Yes | , , — Yes | |
| 1729 | Yes | , , — Yes | |
| 2465 | Yes | , , — Yes |
Check for 561: .
- : , and . Yes.
- : , and (). Yes.
- : , and (). Yes.
Proof Sketch
- If is squarefree and for each , then for any : if then ; if then by Fermat's Little TheoremFermat's Little TheoremFor prime p, a^p is congruent to a mod pRead more →, so .
- By the Chinese Remainder TheoremChinese Remainder TheoremSimultaneous congruences with coprime moduli have a unique solution mod their productRead more →, .
- Conversely, if is not squarefree or some , one can exhibit an with .
- Korselt (1899) proved this characterisation; Robert Carmichael verified in 1910.
Connections
Carmichael numbers demonstrate that Fermat's primality test (checking ) is not conclusive. The Fundamental Theorem of ArithmeticFundamental Theorem of ArithmeticEvery integer greater than 1 has a unique prime factorizationRead more → underpins Korselt's squarefree condition; the Chinese Remainder Theorem (see Chinese Remainder TheoremChinese Remainder TheoremSimultaneous congruences with coprime moduli have a unique solution mod their productRead more →) patches the local conditions together.
Lean4 Proof
/-- 561 = 3 * 11 * 17 — the factorisation of the smallest Carmichael number. -/
theorem carmichael_561_factored : 561 = 3 * 11 * 17 := by norm_num
/-- 561 is squarefree: no prime squared divides it. -/
theorem carmichael_561_squarefree : Squarefree 561 := by decide