Fermat primality test 2026-10-06
The Fermat test looks for a coprime base with . Such a witness proves compositeness by the Fermat little theorem, but Carmichael numbers pass for every coprime base.
Past exam of the mathematics course of the University of Cambridge 2004 ia Paper 4 6E Solution Created 2026-09-24 Updated 2026-09-24
Past exam of the mathematics course of the University of Cambridge 2005 ii Paper 4 1H ii Solution Created 2026-09-24 Updated 2026-09-24
Past exam of the mathematics course of the University of Cambridge 2005 ii Paper 4 1H i Solution Created 2026-09-24 Updated 2026-09-24
Past exam of the mathematics course of the University of Cambridge 2006 ia Paper 4 7E Solution Created 2026-09-24 Updated 2026-09-24
Past exam of the mathematics course of the University of Cambridge 2006 ii Paper 3 1H Solution Created 2026-09-24 Updated 2026-09-24
Past exam of the mathematics course of the University of Cambridge 2015 ii Paper 4 9H iii Solution Created 2026-09-24 Updated 2026-10-06
False. The Carmichael number supplies a counterexample. For every coprime to , the Fermat little theorem gives modulo each of these primes, since all divide . The Chinese remainder theorem then gives . Thus the proposed Fermat primality test can fail to detect a composite for every coprime base.
Past exam of the mathematics course of the University of Cambridge 2018 ii Paper 4 11G b Solution Created 2026-09-24 Updated 2026-10-03
An odd composite coprime to is a Fermat pseudoprime to base when . It is a Carmichael number when this congruence holds for every coprime to .
Suppose a Carmichael number has with . The group is cyclic, so choose a residue of orderBy the Chinese remainder theorem, extend it to an integer that is congruent to modulo every other prime-power factor of . Then , and the Carmichael congruence forces the order of modulo to divide . In particular , contradicting . Therefore every Carmichael number is square-free.
Now assume is square-free. If for every , then for every coprime to , Fermat little theorem givesfor each . The Chinese remainder theorem then gives the congruence modulo , so is Carmichael.
Conversely, if is Carmichael, fix . Choose a primitive root modulo and use the Chinese remainder theorem to choose and . Then , so the order of divides . This proves the Korselt criterion in the required form:
A Carmichael number cannot have one prime factor because it is composite. If with distinct primes , the condition implies , which is impossible. Hence every Carmichael number has at least three prime factors.
Past exam of the mathematics course of the University of Cambridge 2026 ii Paper 4 1G Solution Created 2026-09-24 Updated 2026-09-25
A Carmichael number is a composite such that for every coprime to . For , choose by CRT a number whose residue mod is a primitive root; its order divides . If , choose instead a primitive root modulo ; then , impossible because . Thus is square-free. Write . Since , also ; compositeness gives , hence and . This is Korselt criterion.