Complete Legendre-symbol sum Created 2026-09-29 Updated 2026-11-05
For an odd prime , the complete sum of the Legendre symbol is
Choose a quadratic nonresidue . Multiplication by permutes the finite field , while multiplicativity of the Legendre symbol gives . The sum is therefore equal to its own negative, and is zero. Equivalently, among the nonzero residue classes, exactly half are quadratic residues and half are quadratic nonresidues; the zero term contributes zero.
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.
Let be an odd prime and let be integers with . The quadratic congruence
has a solution exactly when its discriminant is zero or a quadratic residue modulo .
Indeed, completing the square gives the equivalent equation
Multiplication by and translation by give a bijection of the residue classes, because is invertible modulo . Each square root of therefore gives exactly one solution .
Consequently the number of distinct solutions is , using the Legendre symbol: one for zero discriminant, two for a nonzero quadratic residue, and none for a quadratic nonresidue. The hypotheses matter: if the equation can become linear, while at division by is unavailable.
Let be an odd prime and let be an integer congruent to zero or one modulo four. Some integral binary quadratic form of discriminant of a binary quadratic form represents if and only if is a square modulo .
For necessity, a representing vector must have , since a common divisor greater than one would make its square divide . Bézout's identity completes this vector to the first column of a determinant-one integer matrix. Under that proper equivalence, the leading polynomial coefficient becomes , so the transformed form is . Its discriminant gives .
Conversely, choose a root modulo and adjust its parity so . Adding changes parity because is odd. Then
has integer polynomial coefficients, discriminant and value at . If , it is positive definite. If , it is also a primitive binary quadratic form: a common divisor of its coefficients would have to be , contradicting .
The conclusion concerns some form, not every form of that discriminant. For , the construction gives , which represents three. The same-discriminant form does not represent three. Deciding the particular form requires the proper equivalence classes, not only the local square test. When , imprimitive forms can occur, so primitiveness must be checked separately.
Suppose that listed all prime numbers congruent to seven modulo eight. Put , with the empty product equal to one, and define
If an odd prime divides , then , so the second supplementary law for quadratic reciprocity forces or . Since is seven modulo eight, at least one of its prime factors is seven modulo eight. But for every listed prime, so this prime factor is new. The contradiction proves infinitude.
Euler pseudoprime Created 2026-09-24 Updated 2026-11-05
An odd integer that is a composite number is an Euler pseudoprime to a base coprime to when
where the right-hand side is the Jacobi symbol. Here this term refers to the Euler-Jacobi condition, rather than merely requiring the left side to be one of .
Every odd prime satisfies this congruence by Euler's criterion, because its Jacobi symbol is the Legendre symbol. A composite passing it is therefore a false positive for that base in the Solovay-Strassen primality test. For example, and pass: gives , and . A failed congruence instead supplies an Euler witness.
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.
Euler witness Created 2026-09-29 Updated 2026-11-05
For an odd integer and a base coprime to , an Euler witness is a base for which
By Euler's criterion, this failure cannot occur for an odd prime, so it certifies that is a composite number.
For example, take and . Then , while the Jacobi symbol is . Thus the base two witnesses the compositeness of fifteen without supplying its factors. If instead , the greatest common divisor already gives a proper divisor, so a primality test can reject before computing this congruence.
Gauss's lemma (number theory) Created 2026-10-14 Updated 2026-11-05
Let be an odd prime and an integer with . Reduce
to their least positive residue classes modulo . If exactly of these representatives exceed , Gauss's lemma states
The symbol on the left is the Legendre symbol. For example, and give representatives . Exactly one exceeds , so is a quadratic nonresidue modulo .
For a proof, replace every representative above by its negative modulo , obtaining numbers in . These numbers are distinct: equality would give , forcing because . They therefore form a permutation of . Multiplying the signed representatives gives
The factorial is invertible modulo . Cancelling it and applying the Euler criterion proves the lemma. Counting signs can thus replace a potentially large modular exponentiation.
Generalized repunit pseudoprime construction Created 2026-09-24 Updated 2026-11-05
Fix an integer and an odd prime not dividing . Then
is a composite number that is a Fermat pseudoprime to base .
For compositeness, factor
Both factors are integers because is odd, and both exceed one for and . Also , so is coprime to .
By Fermat's little theorem, . Since is invertible modulo , this gives . The displayed sum is odd for either parity of , so . Finally , and raising this identity to the integer power proves .
For and , this produces and . The explicit restriction on matters: instead gives , which fails the base-two test.
A short proof outline connects Gauss's lemma to counting points with integer coordinates. For distinct odd primes , define the two floor function sums
The parity form of Gauss's lemma gives and . In the open rectangle , , the line separates points below it from points above it. None lies on the line, because and coprimality would force . The total is therefore . Combining that count with the parity identities gives quadratic reciprocity.[ref]
Figure 1.
A line partitions the integer coordinate points behind the quadratic reciprocity exponent
. For , the counts are ; for , they are . Dashed edges mark the excluded boundary of the rectangle. This illustrates the counting step; the separate parity step from Gauss's lemma is essential to relate the count to Legendre symbols. Details.
Least quadratic nonresidue Created 2026-10-06 Updated 2026-11-05
For an odd prime , the least quadratic nonresidue is the smallest positive integer whose nonzero residue class is a quadratic nonresidue modulo . For example, the nonzero quadratic residues modulo seven are , so .
The least quadratic nonresidue is itself a prime number. Otherwise it has a factorization with . By minimality, both residue classes are quadratic residues, so and would give , a contradiction. This illustrates why multiplicative information can constrain a least exceptional integer.
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.
Lifting a primitive root to odd prime powers Created 2026-09-24 Updated 2026-11-05
Let be an odd prime and a primitive root modulo . Then is a primitive root modulo every prime power if and only if it is a primitive root modulo . In that case
The condition at says with . The odd-prime case of the lifting-the-exponent lemma, obtained here by repeated use of the binomial theorem and then raising to an exponent not divisible by , gives
Here is the prime valuation. To see the induction step, the first term in has prime valuation , while every later term has strictly greater prime valuation when is odd and .
Any return must have , by its order modulo . Writing , the displayed valuation forces , with equality giving a return. This proves the claimed multiplicative order. The reverse implication follows by taking .
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.
For an odd prime , the number of integers such that both and are quadratic residues modulo is
For example, modulo the quadratic residues are . The qualifying pairs are and , giving .
Write for the Legendre symbol. On the specified range neither input is zero, so the indicator of the required event is . Expand and sum. The complete Legendre-symbol sum gives
The quadratic Legendre-symbol correlation gives : extending to the full finite field only adds the zero terms at . Thus the count is . The first supplementary law for quadratic reciprocity identifies and completes the formula.
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, leaving
For , the same congruence is . This proves Wilson's theorem.
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
Use the standard theorem on reduction of torsion points on an elliptic curve: at a prime of good reduction, reduction is injective on torsion whose order is prime to that prime. Reduction at implies that every odd-primary part of the rational torsion subgroup has order dividing . Thus its only possible odd prime is , and its -primary part has order at most . Reduction at injects the -primary part into a group of order , so that part is trivial. No other primary part can occur.
Consequently the torsion subgroup has order at most three. Since has exact order three,
This argument uses only prime-to-residue-characteristic injectivity, and therefore avoids an unjustified claim of full torsion injectivity at the prime .
Begin with two points at distance one. A ruler draws the line through two known points; a compass draws a circle with a known centre and a constructible radius. New points are intersections of such lines and circles. A real number is constructible when it occurs as a coordinate of a point obtained by finitely many such operations; a complex point is constructible when both coordinates are.
If current coordinates lie in a field , a line-line intersection solves linear equations over , while line-circle or circle-circle intersections reduce to a quadratic equation over . Thus each step requires at most adjoining a square root. Consequently every constructible number lies in a tower
Conversely field sums and differences are obtained by laying off segments, products and quotients by similar triangles, and a positive square root by the geometric-mean construction in a semicircle. Hence every real number in such a tower is constructible. This proves the quadratic-tower criterion, not merely its necessity.
In particular a constructible algebraic number has degree a power of two. Degree alone is not sufficient in general; the exact criterion is containment in a quadratic tower. Equivalently the Galois group of its normal closure is a finite two-group: a tower's normal closure remains a two-extension, and a two-group admits a chain of subgroups with successive index two, yielding the converse by Galois correspondence.
The standard impossibility results follow. Doubling a unit-volume cube requires , whose polynomial is irreducible by Eisenstein and has degree three. Trisecting an arbitrary angle would in particular trisect degrees, requiring , a root of . This cubic has no rational root and is irreducible, so this construction is impossible, although some particular angles can be trisected. Squaring the unit circle requires side length , impossible because is transcendental whereas constructible numbers are algebraic.
For a regular -gon, constructibility is equivalent to that of . The cyclotomic extension is Galois of degree , so it is constructible exactly when this degree is a power of two. Writing the prime factorization of shows the equivalent condition
Indeed odd prime exponents must be one, and each must be a power of two. If is prime, must itself be a power of two by factoring when has an odd divisor. Conversely this factorization makes the cyclotomic Galois group a two-group and provides a quadratic tower. This gives both positive constructions, such as the regular seventeen-gon, and obstructions, such as the regular seven-gon.