Bounded exceptional primes for least quadratic nonresidues Created 2026-10-06 Updated 2026-10-14
If, for every , the smooth numbers up to with all prime factors at most have density at least , then for fixed there are only primes with . Apply the variance form of the large sieve to the indicator function of the -smooth numbers up to . For every exceptional prime, all these numbers are nonzero quadratic residues, so half its nonzero residue classes are empty. Their variance contribution is at least one third of the square of the total count. The large sieve bounds the sum of contributions by a constant times times that count. The density assumption with finishes the argument.
Computing Legendre symbols by quadratic reciprocity Created 2026-10-14 Updated 2026-10-31
The practical reward of quadratic reciprocity is a smaller modulus: swap a pair of distinct odd primes, record the required sign, then reduce the numerator by modular arithmetic. Use multiplicativity of the Legendre symbol and the second supplementary law for quadratic reciprocity to handle a factor of two. For example,
Here are both modulo , so the first swap changes sign; gives ; the swap involving five has no sign change. An independent square check is . The method determines existence of a square root without itself finding that root.
A composite numerator is allowed in a Legendre symbol; a composite denominator instead calls for a Jacobi symbol. Its Jacobi reciprocity law supports repeated swaps and remainder reductions, in the spirit of the Euclidean algorithm.[ref]
A final Jacobi symbol of one is not a square-existence certificate for a composite number modulus. For example,
yet is impossible: reducing it modulo three would require a square congruent to two, and squares modulo three are only zero or one. The product has hidden two local failures. By contrast, for a prime denominator, a Legendre symbol of one does certify a quadratic residue.
Euler's criterion Created 2026-09-24 Updated 2026-10-18
For an odd prime and , Euler's criterion identifies the Legendre symbol by modular exponentiation:
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]
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.
Jacobi reciprocity law 2026-10-14
For coprime positive odd integers , the Jacobi symbol satisfies . It follows by factoring and into primes and multiplying the quadratic reciprocity for each prime pair; the parity of the sums of prime half-differences agrees with and . A Jacobi symbol equal to one does not imply that its numerator is a quadratic residue for a composite denominator.
Legendre symbol Created 2026-09-24 Updated 2026-10-18
For an integer and an odd prime , the Legendre symbol is the integer valued function
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]
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 obeys
In particular, if , then , where is a modular multiplicative inverse. Multiplication by a nonzero square also leaves the Legendre symbol unchanged: for .[ref]
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 .
Figure 1.
Products modulo seven: the Legendre symbol reduces a six-by-six table to sign multiplication
. Rows and columns put quadratic residues before quadratic nonresidues . Every cell displays the product modulo seven and its Legendre symbol. The four blocks have signs , showing the subgroup and its other coset. Details.
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.
Noncongruent primes congruent to three modulo eight Created 2026-10-05 Updated 2026-10-06
For a prime , apply two-isogeny descent to the congruent number elliptic curve and its companion . The first square-class image is exactly , already supplied by 2-torsion. The second has only positive candidates . The quartic covering in a two-isogeny descent equations for and are impossible modulo , because is not a quadratic residue. For the equation is . Coprimality forces odd and ; modulo sixteen this gives , which is impossible. Thus the second image is trivial and the square-class index formula for two-isogeny descent gives rank zero. The same prime-reduction argument bounds its rational torsion by four, and it already has four rational 2-torsion points, so it has no rational point corresponding to a right triangle of area .
If a squarefree positive has a prime divisor , a unit of norm in would give for integers . Modulo this makes a quadratic residue, which is impossible. The obstruction is sufficient, not a full criterion for negative-norm units.
Complete the square-class map at the identity by ; at the finite point its value is the class of . For another rational point write
These denominator powers follow because a negative valuation of forces the leading cubic term to dominate, so that valuation is even and the valuation of is three halves of it. The equation gives
If a prime divides , it does not divide the second factor, since . Thus is even. All denominator valuations are even too. Every image class therefore has a representative which is a signed squarefree divisor of , proving that is finite.
Use the standard 2-isogeny with kernel and dual isogeny satisfying , . Away from the exceptional points one may take
Applying the analogous isogeny to gives a curve with coefficients ; scaling its coordinates by gives the dual map back to . The analogous descent map on has kernel and finite image. The sequence
is exact at the last two terms. Its outside groups are finite, identified with the two finite descent images, so is finite.
For , the rational 2-torsion is , of order four. The first descent image is exactly : these classes occur on the 2-torsion, and the divisor-support bound permits no others. The isogenous curve is . Its real points have , so the second image lies in the four positive classes .
Here the kernel of the dual is contained in , since . Thus the displayed map is injective, and exactness gives
The allowed rank formula makes the left side , so
Now consider the quartic relation. Normalize a nontrivial integer solution so that does not divide both , by dividing them by and by whenever necessary. If , reduction modulo gives , with modulo , making a quadratic residue. If , then and ; write , , divide by , and reduce to get modulo . Again is a square. Therefore
If the class occurred in , write the corresponding coordinate as . The curve equation then gives
Here are nonzero coprime integers and is rational. Since is an integer, its reduced denominator must be one, so is an integer too. For this contradicts the quartic obstruction. Hence class is absent. A subgroup of omitting has order at most two, so and .
For , direct substitution verifies the nonintegral point
A rational torsion point would have integral coordinates by the preceding theorem, so this point has infinite order. Thus , and together with the upper bound,
The nonzero quadratic residues modulo five are . The values of and the numbers of possible are
There are eight affine points and one point at infinity. Thus and part(ii) gives . The curve is nonsingular, since its short-Weierstrass discriminant is nonzero modulo five.
The dual operation reverses products, so . Also and . Squaring the latter identity gives
Therefore . Over the Frobenius is , of degree , so
More generally the Frobenius trace recurrence has , and ; the square calculation is its first nontrivial case.
A nonzero residue class is a quadratic residue if for some nonzero . If it is a square, Fermat's little theorem gives . Conversely, the map on the nonzero classes identifies exactly the pairs , giving distinct squares. They are all roots of over the field ; a polynomial of this degree has at most that many roots. Its roots are therefore precisely the squares. This proves Euler's criterion
Applying it to gives . The exclusion of is the usual nonzero-residue convention needed for this equivalence.
For distinct odd primes , quadratic reciprocity states
Using the multiplicativity of the Legendre symbol, and the supplementary law ,
The first factor is because ; the second is because the reciprocity sign is positive. Thus .
For each , count the roots of , and add the identity at infinity. A nonzero quadratic residue gives two roots, zero gives one, and a nonsquare gives none. Equivalently, with the Legendre symbol extended by ,
The numbers of affine values, in increasing order starting at zero, are
so the answer is
All four reductions are smooth algebraic curves: the original PDF gives the elliptic-curve discriminant , so these odd primes are primes of good reduction.
A suitable large sieve statement is the following. If are separated modulo one by at least and is supported on consecutive integers, then
The sharper classical constant also suffices, but is unnecessary for the requested bound. This is the exponential-sum large sieve.
Put , , and . By the orthogonality of roots of unity,
At most of these residue counts are nonzero. The Cauchy-Schwarz inequality gives , and the frequency contributes exactly . Thus, if ,
If for some prime, is empty and the result is immediate.
All fractions , , , are distinct reduced fractions. Their circular spacing is at least , because two distinct fractions of these denominators differ modulo one by at least . Apply the large sieve with and , and sum the preceding lower bounds:
For and a positive sieve denominator, division proves
When the denominator is zero this asserts no restriction; that degenerate case is interpreted as a vacuous bound.
For the least-nonresidue application, first establish the positive density of power-smooth integers. Fix , with an integer , and let tend to infinity. Choose ordered primes, with repetitions allowed, in the interval
Their product satisfies . Every number has , so is -smooth. By partial summation of the Prime number theorem, or the Mertens theorem for reciprocal primes,
The number of ordered representations is at least
because for .
This representation count must not be confused with a count of distinct integers. A number at most has at most prime factors in that interval, counted with multiplicity. There are therefore only a bounded number, depending on , of ordered -tuples which can occur as divisors of it; the cofactor is then fixed. Dividing by this bounded multiplicity proves
for a fixed and all sufficiently large .
Now work on a dyadic prime interval and let be the primes there with . Take and , so . Let be the -smooth integers at most . The density lemma gives for an absolute .
For each , every prime factor of a member of is at most and is smaller than . Hence it is a nonzero quadratic residue modulo . Multiplicativity of the Legendre symbol makes every member of a nonzero quadratic residue modulo . It therefore avoids all quadratic-nonresidue classes. In the sieve inequality set at exceptional primes and zero at every other prime up to . For odd , , so
Thus each dyadic interval has at most exceptional primes. The finitely many small intervals can be absorbed into this absolute bound. Summing the intervals up to proves the large-sieve logarithmic exceptional-prime bound for least quadratic nonresidues:
The least nonresidue is normally defined for odd primes; any convention at the prime two changes the count by at most one.
Let generate the cyclic group of nonzero residues, whose order is a power of two. Write . Its multiplicative order is , so it is a primitive root precisely when is odd. The quadratic residues are exactly the even powers of . Thus the primitive roots are precisely the quadratic nonresidues, with nonzero residue classes understood.
For , , so quadratic reciprocity gives . Since and alternates between and modulo three, is respectively or modulo seven. The nonzero squares modulo seven are . Consequently , and
There is a genuine endpoint exception if the printed form permits : then and , which has order one and is not primitive. The first equivalence remains true for , but the final assertion requires excluding that prime.
Since , the ring of integers is with discriminant . Write and . Reduction of modulo two gives a double root, and modulo five gives the roots . Thus , , and . Directly , since . The element belongs to and and has field norm ten, so equality of ideal norms gives
The Minkowski bound is , so every ideal class contains an integral ideal of ideal norm at most five. Three is inert and gives no prime ideal of ideal norm three; ideals of ideal norm four are , principal. Thus the class group is generated by , and the displayed relations make every class either trivial or . The class is nontrivial: a generator would have field norm , but would give or , neither a quadratic residue. Hence the class number is two.
The unit has field norm . To show it is fundamental, suppose is a positive real embedding of a unit . Its conjugate is , so is a positive integer less than two. Thus , and forces . Only is greater than one, contrary to the strict inequality. Therefore no smaller unit exceeds one. Multiplying any positive unit by a suitable power of puts it in , proving that all units are .
An element of field norm has principal ideal or by prime ideal factorization. The first is generated by ; the second by , of field norm . Two generators of the same principal ideal differ by a unit. Therefore all, and only, the integer solutions are
The two displayed signs are independent; multiplication by a norm-minus-one unit exchanges the two field norm signs.
Write . In Gauss's lemma, for the multiplier 2, precisely the integers with give residues . Their number is
It is even, so the Legendre symbol : 2 is a quadratic residue modulo . For completeness, the sign rule follows by replacing those large residues by their negatives; the resulting absolute residues permute . Multiplying them and cancelling their nonzero product gives , equivalent to the residue assertion by Euler's criterion.
Now take the prime . The condition gives , so . Thus divides . For integers , (true at 4 and preserved on increasing ), so this divisor is proper and is composite. At , the divisor is the number itself: . The congruence still holds, but it does not establish compositeness.
Suppose . Then modulo the prime number , so Fermat's little theorem gives . But makes odd, and therefore
This contradicts , since is odd. Thus is not a quadratic residue modulo . Apply part (a) to the finite field : the pairs with the given operations form a field, and there are choices for each coordinate, so its cardinality is .
In the multiplicative group , the squaring map is a group homomorphism with kernel , since is odd. Every nonzero square therefore has exactly two square roots. There are quadratic residues and the same number of nonresidues, and consequently .
For , direct multiplication gives . Multiplicativity of the Legendre symbol, including its value zero on multiples of , implies
Inversion permutes , so runs through all residue classes except . Thus
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 gives
Consequently .
Put . The nonzero quadratic residues in the finite field form a subgroup of size : the group homomorphism has kernel . Each square satisfies by Fermat's little theorem. Since a nonzero polynomial of degree has at most roots of a polynomial, these are all the roots of . For any other nonzero , Fermat's theorem gives , so . Thus Euler's criterion follows, and multiplication gives
Both sides are or , which are distinct modulo the odd prime number , so . Taking in Euler's criterion gives , which is for and for .