Past exam of the mathematics course of the University of Cambridge 2001 ia Paper 4 5E a Solution Created 2026-09-24 Updated 2026-10-14
For a prime number , the nonzero residue classes form the multiplicative group of the finite field . Every class has a unique multiplicative inverse. A class equals its own inverse precisely when , so in the field and or .
For an odd prime, pair each remaining class with its distinct inverse. Each pair contributes one to the product, leavingFor , the same congruence is . This proves Wilson's theorem.
Past exam of the mathematics course of the University of Cambridge 2001 ia Paper 4 5E b Solution Created 2026-09-24 Updated 2026-10-14
Write , and . The residues are exactly the odd factors of , in reverse order. Henceby Wilson's theorem. It follows that the odd-residue squared product modulo a prime isThus it is for and for .
Past exam of the mathematics course of the University of Cambridge 2001 ia Paper 4 7E c Solution Created 2026-09-24 Updated 2026-10-14
If with an odd prime, then but . The multiplicative order consequently divides four and is neither one nor two, so it is four. The preceding divisibility result makes necessary.
For sufficiency, suppose and put , an even integer. Pair opposite factors in the factorial:Wilson's theorem gives , explicitly producing a square root of minus one modulo a prime. Thus
Past exam of the mathematics course of the University of Cambridge 2002 ia Paper 4 7B b Solution Created 2026-09-24 Updated 2026-10-14
Put , so the requested modulus is . The factorial is divisible by , and so is . Also, Wilson's theorem gives . Because and are coprime integers, their product divides the difference. Thus the Wilson factorial congruence modulo a triangular number isThe displayed residue lies in the standard range even at .
Past exam of the mathematics course of the University of Cambridge 2006 ii Paper 3 11H Solution Created 2026-09-24 Updated 2026-10-14
The Prime number theorem states that , where counts primes not exceeding . Dirichlet theorem on primes in arithmetic progressions states that if , then the progression contains infinitely many primes.
If for an odd prime , the multiplicative order of modulo is four. Lagrange's theorem therefore gives . Conversely, Wilson's theorem gives . Pairing the factors and yieldsFor , the sign is positive, so the factorial supplies a square root of . Thus is a quadratic residue exactly when .
Write . The odd integer is modulo . If all of its prime factors were modulo , their product, with multiplicities, would be modulo , so at least one factor is modulo . Every prime factor of is odd and satisfies ; the criterion just proved gives . Neither integer is divisible by any , since their residues modulo are respectively and . Starting with any finite list thus produces a new prime in each residue class. Both classes contain infinitely many primes, independently of the general Dirichlet theorem on primes in arithmetic progressions.
Past exam of the mathematics course of the University of Cambridge 2007 ii Paper 4 11F i Solution Created 2026-09-24 Updated 2026-10-14
Compare constant terms in the polynomial identity proved above. The constant term of is , while that of the product is . For odd , this gives . For , the same conclusion holds because . Thus Wilson's theorem follows:
Apply Fermat's little theorem and Wilson's theorem in the ring of integers modulo n with modulus . They giveA vanishing modular congruence modulo is precisely divisibility by , so both divisibilities hold, without requiring .
Wilson's theorem states that an integer is a prime number if and only ifIn particular this holds for every prime, including .
Wilson's theorem states that for a prime , . For odd , pair each nonzero residue with its multiplicative inverse. Only the self-inverse residues remain unpaired; in a field gives . Their product is , proving the result. For the assertion is immediate.
If composite is not the square of a prime, choose a prime divisor such that and are distinct. Both occur among the factors of , so their product divides it. In the remaining case , , and the two distinct factors both occur in the factorial and have product divisible by . Thus the factorial is zero modulo every such composite .
For prime , Wilson's congruence makes the numerator sine squared equal , so its ratio is one. For composite , the numerator vanishes. The only exceptional composite in the sum is four; its ratio is . Therefore for the sum counts the primes plus two, and subtracting two gives exactly the required prime count. All statements concern the integers .
Wilson's theorem states that an integer is prime if and only ifIn particular the congruence holds for every prime , including two.
Wilson's theorem states that an integer is prime if and only if . For a prime , every nonzero residue has a multiplicative inverse. Pair each residue with its inverse; the only self-inverse ones satisfy in and hence are (the same residue when ). The resulting product is . Conversely, if , no divisor of can satisfy : it would divide both and , so could not divide . Hence is prime.
For a composite which is not the square of a prime, choose a proper factorization with if possible. Both factors occur in , proving divisibility by . If the initially chosen factors coincide but their common value is composite, choose a different proper divisor to obtain unequal factors; equivalently, the only composite integer all of whose proper nontrivial divisors coincide is a prime square. For , the distinct factors and lie below and their product is divisible by . Thus for every composite .
For a prime , write . Then , so the summand is one. For a composite it is zero. The only remaining composite index is four, whose summand equals . Therefore the sum is the prime-counting function plus two whenever ; subtraction of two gives the claimed exact formula.
For an odd prime number , put . Both and are divisible by . By Wilson's theorem, they are also congruent modulo , because each is modulo . The coprime integers therefore both divide their difference, giving the displayed integer congruence. This combines the prime-modulus factorial identity with an elementary divisibility constraint.
Wilson's theorem 2026-10-14
For an integer , Wilson's theorem characterizes prime numbers by a factorial:The right side is an integer congruence, so the least nonnegative remainder is . For example, certifies that five is a prime number, whereas rules out six. [ref]
For an odd prime number , each nonzero congruence class has a unique modular multiplicative inverse. Pair each class with its inverse: each distinct pair contributes one. A class is its own inverse exactly when ; since , Euclid's lemma leaves only . Their product is . The prime number two needs a separate check: . Conversely, a proper divisor divides both and , so the displayed integer congruence would force , a contradiction. [ref]
The composite numbers have an even sharper pattern: for every composite number , but . To check the zero claim, write with . If , both occur as different factors in the factorial. If , the different factors and both occur since , and their product is divisible by . The only excluded case is . Thus four is an exception to the zero pattern, but still fails Wilson's theorem: its required remainder would be three.
This is an exact primality testing criterion, but direct evaluation is expensive: even reducing modulo after every multiplication still takes a number of multiplications proportional to , which grows exponentially with the number of binary digits of . The problem is not merely storing a huge factorial. The more useful role of Wilson's theorem is simplifying factorial expressions in modular arithmetic. For instance, if is a prime number, then gives by a modular multiplicative inverse.
