Euler's criterion Created 2026-09-24 Updated 2026-10-18
Thus a quadratic residue gives one and a quadratic nonresidue gives minus one, represented by if a nonnegative remainder is used. The formula also holds when , because and both sides are zero modulo .[ref]
Quadratic Residues by Ben Lynn. Ben Lynn, Quadratic Residues, Euler's Criterion and The Legendre Symbol: exponent test and the zero value
For example, modulo seven the exponent is three: confirms that two is a quadratic residue, while confirms that three is a quadratic nonresidue. Modulo eleven the exponent is five, and confirms that two is a quadratic nonresidue. The test answers whether a square root exists; it does not itself return the roots of .
A short proof needs only Fermat's little theorem and the root bound for a polynomial. Put . If in the prime field, then . There are already such quadratic residues. The nonzero polynomial has polynomial degree , so it has no other polynomial roots. Finally, for every nonzero , Fermat's little theorem gives . Factoring in the field shows ; every quadratic nonresidue must take the remaining value . This proves the criterion without first finding a primitive root.
For a larger original example, decide whether seven is a quadratic residue modulo the prime number . Exponentiation by squaring computes the required power without listing fifty squares:Therefore and has no solution. Each intermediate product is reduced modulo , as in modular exponentiation. The advantage is that exponentiation by squaring uses a number of multiplications proportional to the binary digit length of the exponent rather than testing every potential square root.
The odd prime hypothesis is essential. For the composite modulus nine, , which is neither one nor minus one. Although four is a nonzero square modulo nine, , so even the square-to-one implication fails. The Jacobi symbol and Euler pseudoprime discuss different questions for odd composite moduli; they do not make this a universal square test.
Every odd composite integer has an Euler witness. For a nonsquarefree integer, a base congruent to modulo a repeated prime factor fails the Euler congruence by the binomial theorem. For a squarefree integer, use the Chinese remainder theorem to choose a base that is a quadratic nonresidue modulo one prime factor and modulo another. Its Jacobi symbol is , while its power is modulo the second factor.
For an odd positive nonsquare integer , there are infinitely many primes with Legendre symbol . Choose a residue modulo with Jacobi symbol by making it a quadratic nonresidue at one prime occurring to odd multiplicity and a square at every other prime. The Chinese remainder theorem also imposes and at any finite list of previously found primes. Then Jacobi reciprocity gives , so a prime factor of has and is outside that list.
Least quadratic nonresidue 2026-10-06
For an odd prime , the least quadratic nonresidue is the smallest positive integer whose nonzero residue class is a quadratic nonresidue modulo .
Legendre symbol Created 2026-09-24 Updated 2026-10-18
Its value depends only on the congruence class of modulo ; the displayed notation is a symbol, not division. The value zero handles separately from quadratic residues and quadratic nonresidues.[ref]
Quadratic Residues by Ben Lynn. Ben Lynn, Quadratic Residues, The Legendre Symbol: three values and dependence on an odd prime
For example, , , , and . The equality illustrates that choosing a different integer representative does not change the answer. An arbitrary odd composite denominator uses the Jacobi symbol, not the Legendre symbol. For instance,but two is not a square modulo fifteen: any such square root would also give a square root modulo three, where the only nonzero square is one. A Jacobi symbol of one therefore cannot replace the Legendre symbol's square test.
The Legendre symbol also counts square roots compactly. For every congruence class in the prime field ,The three cases give two, one and zero solutions for a quadratic residue, zero and a quadratic nonresidue, respectively. This is useful when counting solutions of modular congruences involving polynomials: a solvability question becomes a sum of Legendre symbols, as in the complete Legendre-symbol sum and quadratic Legendre-symbol correlation.
Multiplicativity of the Legendre symbol Created 2026-09-29 Updated 2026-10-18
For an odd prime and any integers , the Legendre symbol obeysIn particular, if , then , where is a modular multiplicative inverse. Multiplication by a nonzero square also leaves the Legendre symbol unchanged: for .[ref]
Quadratic Residues by Ben Lynn. Ben Lynn, Quadratic Residues, The Legendre Symbol: multiplicativity and invariance under a nonzero square factor
The subgroup and coset arguments under quadratic residue and quadratic nonresidue prove the sign rule without computing a large power: square times square is square, square times nonsquare is nonsquare, and nonsquare times nonsquare is square. If either factor is zero modulo , both sides of the identity vanish. On , the Legendre symbol is thus a group homomorphism to whose kernel of a group homomorphism is the quadratic residue subgroup. Viewed on all integers, it is a completely multiplicative function and a Dirichlet character modulo .
For an original calculation, factor the numerator . Modulo seven, , agreeing with . Modulo eleven, the signs are instead , giving , agreeing with . The same factorization can therefore certify different square behavior at different prime numbers.
Alternatively, Euler's criterion gives modulo . For nonzero factors both sides correspond to signs in . Since is odd, these signs are distinct modulo , so the modular congruence proves the asserted equality of integers, not merely an equality of representatives.
Past exam of the mathematics course of the University of Cambridge 2008 ii Paper 3 11H Solution Created 2026-09-24 Updated 2026-10-14
For positive odd coprime integers , the Jacobi reciprocity law isFactor . Since is not a square, some is odd. Choose a quadratic nonresidue modulo that , and choose residue one modulo each other . The Chinese remainder theorem provides a positive with these residues and with . Multiplicativity of the Jacobi symbol then gives .
Suppose only finitely many primes satisfy . They are coprime to . Repeat the preceding Chinese remainder theorem construction, additionally imposing at every odd and taking to avoid two. Since , Jacobi reciprocity gives . Factoring this Jacobi symbol over the prime factors of shows that at least one such prime has . But none of the listed primes divides , a contradiction. This proves the infinitely many prime quadratic nonresidues of a nonsquare integer assertion.
Past exam of the mathematics course of the University of Cambridge 2010 ii Paper 2 1G ii Solution Created 2026-09-24 Updated 2026-10-14
Euler's criterion gives in this case. There are equally many nonzero quadratic residues and quadratic nonresidues, so . Replacing by and using the multiplicativity of the Legendre symbol givesConsequently .
Past exam of the mathematics course of the University of Cambridge 2011 ii Paper 4 11I ii Solution Created 2026-09-24 Updated 2026-10-14
Factor . Since it is not a square, one exponent, say , is odd. Choose a nonzero quadratic nonresidue modulo ; one exists because the squaring map on the nonzero residues is two-to-one and hence has only images. The Chinese remainder theorem supplies a positive odd integer satisfyingThen and . The Jacobi reciprocity law proved in part (i), together with , gives . Factoring givesAll are odd and none divides . At least one factor must be negative, yielding an odd prime number . No theorem about primes in arithmetic progressions is needed.
Past exam of the mathematics course of the University of Cambridge 2014 ia Paper 4 6E iii Solution Created 2026-09-24 Updated 2026-10-06
Suppose is a quadratic nonresidue. On the nonzero residue classes modulo , define the involutionIt is an involution because . A fixed point would satisfy , which is excluded by the quadratic nonresidue hypothesis. Thus it partitions the classes into disjoint pairs , each with product . ConsequentlyNow evaluate the same product by pairing every class with its own modular inverse. The only classes equal to their modular inverses solve and hence are and . All other pairs have product one. The complete product is therefore , soTogether with the preceding part, this is Euler's criterion; the pairing argument establishes the converse without assuming it.
Past exam of the mathematics course of the University of Cambridge 2015 iii Paper 27 1 c Solution Created 2026-10-03 Updated 2026-10-06
For coefficients supported on an interval of length , write and . The variance form of the large sieve statesThe constant is absolute. One may take the explicit right side , by orthogonality of roots of unity and the exponential-sum large sieve proved in Question 2.
Take , , and the indicator function of the -smooth numbers up to . Applying the given smooth-number density with parameter giveswith a harmless adjustment of the constant for integer endpoints. If an odd prime has least quadratic nonresidue , then : a quadratic nonresidue always occurs among . Every prime factor of every selected smooth number is thus a nonzero quadratic residue modulo . By the multiplicativity of the Legendre symbol, every selected number is a nonzero quadratic residue modulo .
There are nonzero quadratic nonresidue classes, and on all of them. Their contribution to the variance is at leastIf denotes the number of exceptional primes, the variance form of the large sieve, with , yields . ConsequentlyThis is the bounded exceptional primes for least quadratic nonresidues argument. Using an interval of length is what matches the term; an interval of length would not give a bounded exceptional set.
Past exam of the mathematics course of the University of Cambridge 2015 ii Paper 4 9H ii Solution Created 2026-09-24 Updated 2026-10-06
True. Since is not a square, some exponent is odd. Choose a quadratic nonresidue modulo that and choose residue one at every other prime. The Chinese remainder theorem produces a unit modulo with . Multiplication by permutes the residue classes modulo . Thus, by multiplicativity of the Jacobi symbol,The sum is therefore . Nonunits contribute zero, so the permutation argument covers every term.
Past exam of the mathematics course of the University of Cambridge 2015 ii Paper 4 9H iv Solution Created 2026-09-24 Updated 2026-10-06
True. First suppose with maximal. By the Chinese remainder theorem, choose and modulo all other prime-power factors. This is a unit, with Jacobi symbol one, because it is one modulo every prime. For , the binomial theorem givesbecause and all higher terms contain . It is therefore a witness to the desired failure.
If is square-free and composite, it has at least two prime factors. Choose to be a quadratic nonresidue at one prime and one at every other prime, again using the Chinese remainder theorem. Then . At a different odd prime , however, . These two cases prove that every odd composite has an Euler-Jacobi witness, unlike the situation for the ordinary Fermat primality test.
Past exam of the mathematics course of the University of Cambridge 2019 iii Paper 125 2 a Solution 2026-10-03
If , square-freeness gives the cuspidal reduction . Its nonsingular group is isomorphic to the additive group , so it is cyclic of order .
Suppose . The reduction is an elliptic curve. Since , is a quadratic nonresidue. Pairing with in the quadratic-character sum and usingshows that the two contributions cancel. Therefore . The three roots are distinct, so the full 2-torsion is rational. A cyclic group has at most two elements killed by , hence is noncyclic. Thus
Past exam of the mathematics course of the University of Cambridge 2019 ii Paper 2 1I Solution Created 2026-09-24 Updated 2026-10-03
If the positive odd integer has prime factorizationits Jacobi symbol iswhere each factor is a Legendre symbol; by convention . Thus the symbol is zero exactly when .
The quadratic reciprocity law for the Jacobi symbol says that for coprime positive odd integers ,To prove it, write and . The quadratic reciprocity law for distinct odd primes statesMultiplying this identity over with multiplicities gives the required product of Jacobi symbols. Its sign exponent modulo two isbecause multiplication of odd integers adds the quantities modulo two. This proves the law.
For the requested value, two applications of reciprocity givesince , , and is a quadratic nonresidue modulo .
Past exam of the mathematics course of the University of Cambridge 2020 ii Paper 3 11H iii Solution Created 2026-09-24 Updated 2026-09-29
Write . Choose a quadratic nonresidue . Multiplication by permutes , while multiplicativity of the Legendre symbol gives . Thereforeso the complete Legendre-symbol sum is zero.
Since and , the bijection reduces the next sum to . Count pairs satisfying . On one hand their number isOn the other hand , and every gives exactly one pair by , . There are therefore pairs, proving the quadratic Legendre-symbol correlation
For , the indicator that both and are quadratic residues is . Summing and using the two identities above gives the number of consecutive nonzero quadratic residues modulo an odd prime
Past exam of the mathematics course of the University of Cambridge 2020 ii Paper 3 1H Solution Created 2026-09-24 Updated 2026-09-29
Let be the unit group of residue classes modulo , and partition it into the set of bases satisfying the displayed congruence and the set of Euler witnesses that do not. If , multiplication by maps injectively into : indeed, if and also lay in , then the multiplicativity of the Jacobi symbol would giveCancelling the invertible congruence for would say that , a contradiction. Hence , so at least half of the coprime bases are witnesses.
It remains to construct one witness for every odd composite number . If is not squarefree, choose an odd prime number with . The Chinese remainder theorem gives a unit such that for the full power and modulo every other prime-power factor. The binomial theorem givesSince , this is neither nor modulo , whereas the Jacobi symbol is always or . Thus is a witness.
If is squarefree and composite, choose distinct primes . By the Chinese remainder theorem, choose to be a quadratic nonresidue modulo and to satisfy modulo every other prime divisor of . Then , while , so the Euler congruence again fails. This proves the existence of an Euler witness for every odd composite integer.
Past exam of the mathematics course of the University of Cambridge 2021 ii Paper 1 1I Solution Created 2026-09-24 Updated 2026-09-25
Euler's criterion states that for an odd prime number and ,where the right-hand side is the Legendre symbol.
Let be a primitive root modulo . Its multiplicative order is , so . This power has square , and the only roots of modulo the odd prime are . ThereforeEuler's criterion now gives , so every primitive root is a quadratic nonresidue.
Now let be a Fermat prime, with . The number of primitive roots modulo isThere are also exactly quadratic nonresidues. Since every primitive root is a nonresidue, these equally large sets coincide. Thus every quadratic nonresidue modulo is a primitive root, as summarized by Quadratic nonresidues modulo a Fermat prime.
Finally, and . Quadratic reciprocity therefore givesHence is a quadratic nonresidue modulo , and consequently
Past exam of the mathematics course of the University of Cambridge 2024 iii Paper 136 5 b Solution Created 2026-09-24 Updated 2026-09-25
Let . Its minimal polynomial is , whose discriminant is . Since , the prime does not divide the index , so the Dedekind factorization theorem applies at . In ,The quadratic factor has discriminant , which is a quadratic nonresidue modulo , so it is irreducible. ThereforewhereTheir residue-field degrees are one and two. Both factors of occur with multiplicity one, so both prime-ideal exponents are one. Hence neither nor is ramified.
Let be the sum of the nonzero quadratic residues. Each has two square roots by part (iii), sowhere part (ii) applies because makes not divide . Since is invertible modulo , .
The sum of all nonzero classes is . Subtracting shows that the sum of quadratic nonresidues is also zero. Consequently both requested sums vanish modulo .
