Carmichael Number — Definition, Formula & Examples
A Carmichael number is a composite (non-prime) number that behaves like a prime in Fermat's Little Theorem — it satisfies for every integer , even though it is not actually prime.
A composite positive integer is a Carmichael number if and only if for all integers . Equivalently, by Korselt's criterion, is a Carmichael number if and only if is square-free and, for every prime dividing , the quantity divides .
Key Formula
Where:
- = A composite positive integer (the candidate Carmichael number)
- = Any integer
How It Works
Fermat's Little Theorem says that if is prime, then for every integer . This fact is used as a quick test: if a number fails this condition for some , it cannot be prime. Carmichael numbers are the "impostors" — composite numbers that pass this test for every base . To verify that a number is Carmichael, you can use Korselt's criterion: factor the number, confirm it is square-free, and check that divides for each prime factor .
Worked Example
Problem: Verify that 561 is a Carmichael number using Korselt's criterion.
Factor 561: Find the prime factorization of 561.
Check square-free: No prime factor is repeated, so 561 is square-free.
Check divisibility condition: Compute . For each prime factor , verify .
Answer: Since 561 is composite, square-free, and divides 560 for each prime factor , the number 561 is a Carmichael number — the smallest one, in fact.
Why It Matters
Carmichael numbers reveal a fundamental limitation of Fermat's primality test, which is why modern cryptographic systems like RSA rely on stronger tests such as Miller-Rabin. Understanding these "pseudoprimes" is essential in any course covering computational number theory or cryptography.
Common Mistakes
Mistake: Assuming Fermat's Little Theorem can definitively prove a number is prime.
Correction: Passing the Fermat test for all bases only means the number is either prime or a Carmichael number. Carmichael numbers are composite yet satisfy the test, so a different primality test is needed for certainty.
