Fermat primality test Created 2026-10-06 Updated 2026-10-14
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-10-14
The modular congruence first implies . Multiplication by such an permutes the nonzero residue classes modulo the prime : if , cancellation gives . Multiply all these residues and cancel their nonzero product to obtain , the usual short proof of Fermat little theorem.
Now . By the Euclid lemma, either or . In the latter case, because ,contradicting the preceding product argument, since is odd. ThusNo unproved assertion about the number of fourth roots is needed.
Past exam of the mathematics course of the University of Cambridge 2004 ia Paper 4 6E Solution Created 2026-09-24 Updated 2026-10-14
For a prime number and an integer coprime to , multiplication by permutes the nonzero residue classes modulo . Indeed, implies , and none of the products is zero. Taking the product over the classes givesThe factorial is coprime to and can be cancelled, proving Fermat little theorem: .
Now and is coprime to , so it is coprime to . Since , the proved theorem givesThus the two specified integer congruences modulo are equivalent. In this particular step the additional hypothesis is not needed; it will hold for the squarefree factorization used next.
If is a squarefree integer, its distinct prime factors are pairwise coprime. Consequently divides exactly when every prime factor does. Applying the preceding equivalence with provesFinally retain this squarefree hypothesis. If divides , write . Fermat little theorem gives for every prime factor. Their pairwise coprimality then gives . For composite this is the sufficient direction of the Korselt criterion for a Carmichael number; primality is not excluded by the requested implication.
Past exam of the mathematics course of the University of Cambridge 2005 ia Paper 4 1E Solution Created 2026-09-24 Updated 2026-10-14
The Wilson theorem says that for a prime number . Thus , and since , we get . The Fermat little theorem says when does not divide . Applying it to gives , so is the inverse of modulo . Since , the required residue isThis is the unique representative in .
For the simultaneous integer congruences, the modulus- condition is already implied by . Write ; the modulus- condition becomes , hence . The modulus- condition then gives , or . ThereforeEvery such integer satisfies all four integer congruences; reversing the substitutions shows that there are no others. The uniqueness modulo also follows from the Chinese remainder theorem applied to the coprime moduli .
Past exam of the mathematics course of the University of Cambridge 2010 ia Paper 4 1E a Solution Created 2026-09-24 Updated 2026-10-14
Since is a prime number, the Wilson theorem states that . But , so the modular inverse of , which is , givesThe Fermat little theorem states that when is prime and . Therefore , andsince . Combining these modular congruences,This representative lies between and , so it is the least nonnegative residue.
Past exam of the mathematics course of the University of Cambridge 2010 ia Paper 4 6E Solution Created 2026-09-24 Updated 2026-10-14
The Fermat little theorem states that if is a prime number, then for every integer . Equivalently, for , .
To prove it when , multiplication by permutes the nonzero residues . Indeed, implies , and the Euclid lemma implies in this range. Multiplying all these residues givesNone of the factors of is divisible by , so the factorial has a modular inverse. Cancelling it proves , hence . When , the latter identity has both sides zero, completing the proof.
For an odd prime number , the numbers are coprime. The Fermat little theorem gives , and consequentlyThese exponents are distinct, so infinitely many are obtained.
Write the repdigit with copies of asIf , choose to be any positive multiple of . Then has a modular inverse modulo , so . Division by cannot be used modulo ; instead gives , so for every . If , every is divisible by . ThusThe separate treatment of accounts for the prime factor of the geometric-sum denominator.
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
Repdigit Created 2026-10-14 Updated 2026-10-20
A repdigit is a positive integer whose base- expansion repeats one nonzero digit . For , and , the finite geometric series gives . For example, has decimal digits, all equal to five.
Every prime number not dividing divides infinitely many such repdigits. If it divides , every length works. Otherwise, if it does not divide , the Fermat little theorem gives divisibility for lengths that are multiples of , and division by is justified by its modular inverse. If , the sum is congruent to modulo , so lengths divisible by work instead. A prime dividing but not divides none, since . This distinction prevents invalid cancellation of the geometric-sum denominator.