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 2003 ia Paper 4 6C ii Solution Created 2026-09-24 Updated 2026-09-24
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 ia Paper 4 1E Solution Created 2026-09-24 Updated 2026-09-24
Past exam of the mathematics course of the University of Cambridge 2010 ia Paper 4 1E a Solution Created 2026-09-24 Updated 2026-09-24
Past exam of the mathematics course of the University of Cambridge 2010 ia Paper 4 6E Solution Created 2026-09-24 Updated 2026-09-24
Past exam of the mathematics course of the University of Cambridge 2015 ia Paper 4 2E Solution Created 2026-09-24 Updated 2026-10-06
The Chinese remainder theorem says that for pairwise coprime integers , any prescribed residue modulo each is realized by exactly one residue class modulo . The Fermat little theorem says that for a prime number and an integer not divisible by , ; equivalently, for every integer .
For the given prime number, write . Its square is for some integer , since one of two consecutive integers is even. Therefore . The Fermat little theorem applied modulo gives , hence ; applied modulo it gives . These applications are valid because .
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 2016 ia Paper 4 1E Solution Created 2026-09-24 Updated 2026-10-06
The extended Euclidean algorithm givesBack-substituting in these equations produces the Bezout identityThus one integer solution is . In fact, subtracting this Bezout identity from any other solution and using that and are coprime integers gives all solutions: , , where .
For the modular arithmetic calculation, is a prime number and is coprime to it, so Fermat little theorem gives . Since , and the preceding Bezout identity identifies as the modular multiplicative inverse of , we obtainConsequently the least positive representative is .
Past exam of the mathematics course of the University of Cambridge 2016 iii Paper 104 6 c Solution Created 2026-10-03 Updated 2026-10-06
The auxiliary Higman group has no nontrivial finite quotients of a group. One can use this permitted property directly, but there is a short verification. In any finite quotient, let be the order of the image of . Since conjugation sends to its square, must be odd. If some , choose the least prime number dividing any . It is odd. Conjugation by the preceding generator givesThe multiplicative order of modulo is therefore a divisor of . It is greater than one and divides by the Fermat little theorem, so it has a prime divisor smaller than . That prime also divides , contradicting the choice of . Hence every and the quotient is trivial.
Given any finitely presented group , form , and apply part (a) to the word . This word is nontrivial by the normal form theorem for a free product, so the output contains by the embedding already proved.
To check its finite quotients, let be any group homomorphism to a finite group. The image of the copy of is trivial by the preceding property. The identifications make all trivial. Thus the equations give, in the image,Since , this forces for all generators of , including . The defining word then has trivial image, so as well. Every generator of has trivial image. ThereforeThis uses the concrete construction of part (a), not an assumption that arbitrary quotients preserve an embedding of .
Past exam of the mathematics course of the University of Cambridge 2018 ii Paper 4 11G a Solution Created 2026-09-24 Updated 2026-10-03
The Fermat-Euler theorem states thatIndeed, if are the reduced residue classes modulo , multiplication by permutes them. ThereforeThe product is invertible modulo , so cancellation gives the theorem.
Now let be prime. If , then for , Fermat little theorem gives , while makes . Thus for every integer .
Conversely, assume this congruence holds for every . Choose a primitive root modulo . Then . Since has order , one has . Hence
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 2024 ia Paper 4 1E Solution Created 2026-09-23 Updated 2026-09-25
The Wilson theorem states that for a prime ,Indeed, every nonzero residue modulo has a unique multiplicative inverse. The only residues equal to their own inverses solve , hence are and . Pairing every other residue with its distinct inverse leaves