Fact-checked by Grok 2 weeks ago

Quadratic residue

In number theory, a quadratic residue modulo an integer n is a nonzero integer a coprime to n for which the congruence x^2 \equiv a \pmod{n} has a solution in integers x. This concept distinguishes elements that are perfect squares in the multiplicative group modulo n from those that are not, playing a foundational role in the study of modular arithmetic and Diophantine equations. The theory of quadratic residues originated in the 17th century with Pierre de Fermat's investigations into sums of squares and conditions under which primes could be expressed in specific forms, though without formal proofs. In the , Leonhard Euler advanced the subject by proving several of Fermat's claims and conjecturing the law of , a pivotal result linking the quadratic residuosity of primes each other. provided the first complete proof of in his 1801 , unifying scattered results into a coherent framework that revolutionized and earned the law the title of its "most beautiful" theorem. For an odd prime p and a not divisible by p, exactly (p-1)/2 nonzero residues p are quadratic residues, a fact that underscores their balanced distribution in finite fields. Central to the topic is the \left( \frac{a}{p} \right), defined as 1 if a is a quadratic residue modulo p, -1 if a quadratic nonresidue, and 0 if p divides a; it satisfies multiplicativity and is computable via Euler's criterion, which states \left( \frac{a}{p} \right) \equiv a^{(p-1)/2} \pmod{p}. The law of asserts that for distinct odd primes p and q, \left( \frac{p}{q} \right) \left( \frac{q}{p} \right) = (-1)^{(p-1)/2 \cdot (q-1)/2}, enabling efficient determination of quadratic residuosity without exhaustive search. Special cases include -1 being a quadratic residue modulo p if and only if p \equiv 1 \pmod{4}, and 2 being one if p \equiv 1 or $7 \pmod{8}. Quadratic residues find extensive applications in modern mathematics and computing, particularly in primality testing algorithms like the Solovay-Strassen test, which leverages Euler's criterion to probabilistically verify primality. In cryptography, the quadratic residuosity problem—distinguishing residues from nonresidues modulo a composite n without knowing its factorization—underlies the security of the Goldwasser-Micali cryptosystem, a probabilistic public-key encryption scheme introduced in 1982. These uses highlight the concept's enduring relevance in securing digital communications and advancing computational number theory.

Definition and Basic Concepts

Definition

In , an a is defined as a quadratic residue n if there exists an x such that x^2 \equiv a \pmod{n} and \gcd(a, n) = 1. If no such x exists under the coprimality condition, then a is a quadratic nonresidue n. When \gcd(a, n) > 1, a is neither a residue nor a nonresidue in this context, though the case a \equiv 0 \pmod{n} is sometimes regarded as a trivial quadratic residue since $0^2 \equiv 0 \pmod{n}. This distinction relies on basic , where relations partition integers into residue classes. For illustration, consider n = 5: the squares modulo 5 are $0^2 \equiv 0, $1^2 \equiv 1, $2^2 \equiv 4, $3^2 \equiv 4, and $4^2 \equiv 1, yielding quadratic residues 0, 1, and 4 (with 0 trivial and 1, 4 coprime to 5). The integers 2 and 3, coprime to 5 but not squares, are quadratic nonresidues. Within the (\mathbb{Z}/n\mathbb{Z})^* of units n, the quadratic residues (excluding 0) form a when n is prime; specifically, for an odd prime p, this has index 2, comprising exactly (p-1)/2 elements out of the p-1 units.

Notations

The \left( \frac{a}{p} \right) is a standard notation in for an a and an odd prime p, defined to equal 0 if p divides a, 1 if a is a quadratic residue p with \gcd(a, p) = 1, and -1 if a is a quadratic non-residue p. This symbol is completely multiplicative in the upper argument, satisfying \left( \frac{ab}{p} \right) = \left( \frac{a}{p} \right) \left( \frac{b}{p} \right) for any integers a and b. Euler's criterion provides a computational relation: \left( \frac{a}{p} \right) \equiv a^{(p-1)/2} \pmod{p} when p \nmid a. The Jacobi symbol \left( \frac{a}{n} \right) generalizes the Legendre symbol to an odd positive integer n > 1 and integer a, defined via the prime factorization n = p_1^{k_1} \cdots p_r^{k_r} as \left( \frac{a}{n} \right) = \prod_{i=1}^r \left( \frac{a}{p_i} \right)^{k_i}, where each \left( \frac{a}{p_i} \right) is the Legendre symbol; it equals 0 if \gcd(a, n) > 1. When n is prime, the Jacobi symbol coincides with the Legendre symbol, but in general, \left( \frac{a}{n} \right) = 1 does not imply that a is a quadratic residue modulo n. Like the Legendre symbol, the Jacobi symbol is completely multiplicative in both arguments. The Kronecker symbol extends the to arbitrary integers n, denoted \left( \frac{a}{n} \right) or \left( \frac{a}{n} \right)_K, and is defined to match the when n > 0 is odd, with additional rules for n = -1 and n = 2: \left( \frac{a}{-1} \right) = (-1) if a < 0 and 1 if a \geq 0; \left( \frac{a}{2} \right) = 0 if a is even, 1 if a \equiv \pm 1 \pmod{8}, and -1 if a \equiv \pm 3 \pmod{8}. It preserves multiplicativity and serves as a quadratic character modulo any integer discriminant. Standard conventions for these symbols treat the upper argument a as any integer, often reduced modulo |n| for computation, with negative values handled via multiplicativity: for example, \left( \frac{-a}{p} \right) = \left( \frac{-1}{p} \right) \left( \frac{a}{p} \right) where \left( \frac{-1}{p} \right) = (-1)^{(p-1)/2}. The Legendre and Jacobi symbols are undefined for the even prime 2, but the Kronecker symbol accommodates it directly.

Properties and Elementary Facts

Modulo a Prime

When the modulus is a prime p, quadratic residues exhibit particularly simple and well-understood properties due to the structure of the multiplicative group (\mathbb{Z}/p\mathbb{Z})^\times. For an odd prime p, the nonzero quadratic residues modulo p are precisely the squares of the nonzero elements in \mathbb{Z}/p\mathbb{Z}, and there are exactly (p-1)/2 such distinct residues. These form a subgroup of index 2 in (\mathbb{Z}/p\mathbb{Z})^\times, which has order p-1, reflecting the fact that the squaring map is a 2-to-1 homomorphism onto this subgroup. A fundamental characterization is given by Euler's criterion, which states that for an odd prime p and an integer a not divisible by p, a is a quadratic residue modulo p if and only if a^{(p-1)/2} \equiv 1 \pmod{p}. If instead a^{(p-1)/2} \equiv -1 \pmod{p}, then a is a quadratic non-residue modulo p. This criterion follows from properties of the multiplicative group and , providing an efficient computational test for residuosity. Gauss's lemma offers another key perspective, relating the Legendre symbol (a/p) to the least absolute residues of multiples of a. Specifically, for an odd prime p and a coprime to p, consider the integers a, 2a, \dots, ((p-1)/2)a reduced modulo p to their least absolute residues (between -p/2 and p/2). Let n be the number of these residues that are negative. Then (a/p) = (-1)^n, so a is a quadratic residue if and only if n is even. This lemma underpins many proofs in the theory and highlights the parity of sign changes in the residues. In terms of structure, every nonzero quadratic residue modulo an odd prime p has exactly two distinct square roots in \mathbb{Z}/p\mathbb{Z}, namely x and -x for any square root x, since the equation y^2 \equiv a \pmod{p} with a \not\equiv 0 \pmod{p} has precisely two solutions by the group properties. This contrasts with the zero residue, which has a unique square root, namely 0. The set of quadratic residues and non-residues each has size (p-1)/2, and multiplication by a fixed quadratic non-residue establishes a bijection between them, as it maps the subgroup of residues to its coset of non-residues. The case modulo 2 is exceptional and simpler: the quadratic residues are 0 and 1, since $0^2 \equiv 0 \pmod{2} and $1^2 \equiv 1 \pmod{2}, with every integer congruent to one of these. For small odd primes, explicit examples illustrate these properties; modulo 5, the nonzero residues are 1 and 4 (from $1^2 \equiv 1, $2^2 \equiv 4, $3^2 \equiv 4, $4^2 \equiv 1); modulo 7, they are 1, 2, and 4 (from squares yielding these values). Such computations confirm the count and subgroup structure for primes like the Fermat prime 5 or 17.

Modulo a Prime Power

When considering quadratic residues modulo a prime power p^k where p is an odd prime and a is coprime to p, a is a quadratic residue modulo p^k if and only if it is a quadratic residue modulo p. This equivalence follows from the ability to lift solutions of the congruence x^2 \equiv a \pmod{p} to higher powers using . To apply Hensel's lemma, consider the polynomial f(x) = x^2 - a. Suppose x_0 is a solution modulo p, so f(x_0) \equiv 0 \pmod{p}. The derivative is f'(x) = 2x, and since p is odd, $2 \not\equiv 0 \pmod{p}. Moreover, as a \not\equiv 0 \pmod{p}, x_0 \not\equiv 0 \pmod{p}, ensuring f'(x_0) = 2x_0 \not\equiv 0 \pmod{p}. Thus, each of the two distinct solutions modulo p lifts uniquely to a solution modulo p^k, yielding exactly two solutions modulo p^k. For example, consider x^2 \equiv 1 \pmod{9} where p=3 and k=2. Modulo 3, the solutions are x \equiv 1 \pmod{3} and x \equiv 2 \pmod{3} (since $2 \equiv -1 \pmod{3}). Applying lifts these to x \equiv 1 \pmod{9} and x \equiv 8 \pmod{9} (since $8 \equiv -1 \pmod{9}), confirming two solutions. The case p=2 requires separate treatment due to the even characteristic. Modulo 8 ($2^3), the quadratic residues are 0, 1, and 4. For odd a, only 1 is a quadratic residue modulo 8. Modulo 16 ($2^4), the odd quadratic residues are 1 and 9. In general, for k \geq 3, the odd quadratic residues modulo $2^k are precisely the integers congruent to 1 modulo 8, and there are $2^{k-3} such residues. Each such residue has exactly four solutions modulo $2^k. For instance, x^2 \equiv 2 \pmod{8} has no solutions, as 2 is not among the quadratic residues modulo 8. Solutions can sometimes lift further, but the condition for being a quadratic residue modulo $2^k is stricter than for odd primes and depends on congruence classes modulo 8.

Modulo a Composite

When the modulus n is composite, say n = \prod_{i=1}^t p_i^{k_i} where the p_i are distinct primes and k_i \geq 1, an integer a is a quadratic residue modulo n if and only if the congruence x^2 \equiv a \pmod{n} has a solution, which by the is equivalent to the congruence having a solution modulo each prime power factor p_i^{k_i}. This decomposition follows from the ring isomorphism \mathbb{Z}/n\mathbb{Z} \cong \prod_{i=1}^t \mathbb{Z}/p_i^{k_i}\mathbb{Z}, which implies that solvability in the product ring holds precisely when it holds componentwise. For the multiplicative group of units, (\mathbb{Z}/n\mathbb{Z})^\times \cong \prod_{i=1}^t (\mathbb{Z}/p_i^{k_i}\mathbb{Z})^\times, so quadratic residuosity for a coprime to n likewise decomposes across the factors. Assuming \gcd(a, n) = 1, the (a/n) provides a necessary condition for a to be a modulo n: if a is a quadratic residue modulo n, then (a/n) = 1. However, this condition is not sufficient, as (a/n) = 1 does not guarantee the existence of a solution to x^2 \equiv a \pmod{n}. For instance, consider n = 15 = 3 \times 5; here, the quadratic residues modulo 15 among the units are 1 and 4, which are precisely those a coprime to 15 that are quadratic residues modulo both 3 and 5. Yet, a = 2 satisfies (2/15) = (2/3)(2/5) = (-1)(-1) = 1, but 2 is not a quadratic residue modulo 15, since it fails to be one modulo 3 (where the nonzero squares are only 1) and modulo 5 (where they are 1 and 4). If a is a quadratic residue modulo each p_i^{k_i}, the total number of solutions to x^2 \equiv a \pmod{n} is the product of the number of solutions modulo each p_i^{k_i}. For example, when n is square-free (i.e., k_i = 1 for all i and all p_i odd), and a is coprime to n, there are exactly $2^t solutions if a is a quadratic residue modulo n, corresponding to choices of square roots in each \mathbb{Z}/p_i\mathbb{Z}. In the case of multiple distinct odd prime factors, the proportion of quadratic residues among units modulo n is \frac{1}{2^t}, reflecting the balanced decomposition across factors.

Historical Development

Early Contributions

In the European Renaissance, Pierre de Fermat (1607–1665) initiated systematic study of squares modulo primes through his correspondence and unpublished notes. In a 1640 letter to , Fermat stated his —that if p is prime and a not divisible by p, then a^{p-1} \equiv 1 \pmod{p}—which underpins criteria for quadratic residues, as the exponent (p-1)/2 distinguishes residues from non-residues. He also asserted that an odd prime p is a sum of two squares if and only if p \equiv 1 \pmod{4}, equivalent to -1 being a quadratic residue modulo p, and examined residues modulo small primes like 5 and 13, noting patterns such as the quadratic residues modulo 5 being 0, 1, and 4. Leonhard Euler (1707–1783) advanced these ideas in the 18th century, introducing the term "quadratic residue" (Latin: residuum quadratica) in his 1754–1755 paper "Demonstratio theorematis Fermattiani omnium numerorum primorum formae $4n+1 in quadraticas primarias resolvi posse." Euler formalized properties of quadratic residues modulo primes, proving in 1749 that if a and b are coprime integers, then a^2 + b^2 has no prime divisor congruent to $3 \pmod{4}, linking sums of squares to residue classes. He developed (discovered around 1748): for odd prime p and a not divisible by p, a is a quadratic residue modulo p if and only if a^{(p-1)/2} \equiv 1 \pmod{p}. Euler also computed explicit lists of quadratic residues for small primes, such as modulo 7 (0, 1, 2, 4), emphasizing their role in number-theoretic patterns without a general reciprocity law. Joseph-Louis Lagrange (1736–1813) contributed in 1770 with his four-square theorem, proving that every natural number is the sum of four integer squares, published in Nouveaux mémoires de l'Académie royale des sciences et belles lettres de Berlin. This result extended Fermat's two-square theorem and provided further insights into sums of squares, though Lagrange focused more on integer representations than modular criteria. His work highlighted isolated facts, like the residues modulo small composites, bridging elementary observations toward deeper theory.

Formulation of Quadratic Reciprocity

The law of quadratic reciprocity emerged in the late 18th and early 19th centuries as a pivotal advancement in number theory, building on earlier efforts to understand quadratic residues modulo primes. Adrien-Marie Legendre made significant partial contributions in 1785 through his paper Recherches d'analyse indéterminée, where he stated a version of the reciprocity law for distinct odd primes p and q, but his attempted proof was incomplete and covered only certain cases, failing to address all scenarios rigorously. Carl Friedrich Gauss independently discovered and proved the full law in 1796 at the age of 19, though he delayed publication until 1801 in his seminal work , which integrated the concept of quadratic residues into a comprehensive framework for arithmetic. In this text, Gauss formulated the law for distinct odd primes p and q as \left( \frac{p}{q} \right) \left( \frac{q}{p} \right) = (-1)^{\frac{p-1}{2} \cdot \frac{q-1}{2}}, where \left( \frac{\cdot}{\cdot} \right) denotes the , and he provided the first two proofs, later developing six more distinct proofs over his career—eight in total—demonstrating his deep commitment to the theorem he called the "fundamental theorem" in the doctrine of residues. Gauss also established the supplementary laws: for an odd prime p, \left( \frac{2}{p} \right) = (-1)^{\frac{p^2 - 1}{8}}, \quad \left( \frac{-1}{p} \right) = (-1)^{\frac{p-1}{2}}. These formulations completed the criteria for determining whether one prime is a quadratic residue modulo another. In the 1840s, Gotthold Eisenstein contributed elegant geometric proofs that simplified Gauss's third proof, offering more intuitive visualizations using lattice points and avoiding some technical complexities, as detailed in his 1845 exposition. The publication of these results in Disquisitiones Arithmeticae and subsequent works revolutionized the field, enabling efficient computation of Legendre symbols without exhaustive trial, thus facilitating broader applications in number theory.

Distribution and Analytic Aspects

Counting Quadratic Residues

For an odd prime p, the multiplicative group (\mathbb{Z}/p\mathbb{Z})^* has order p-1, and the image of the squaring map on this group consists of exactly (p-1)/2 nonzero quadratic residues, since the map is 2-to-1 onto its image. Including 0, which is always a quadratic residue (as $0^2 \equiv 0 \pmod{p}), the total number of quadratic residues modulo p is (p+1)/2. This count holds because exactly half of the nonzero residues modulo p are squares, a consequence of the cyclic structure of (\mathbb{Z}/p\mathbb{Z})^*, where the subgroup of squares has index 2. As p varies over odd primes, approximately half of the elements in \{0, 1, \dots, p-1\} are quadratic residues, reflecting the balanced distribution in the cyclic group. In the integers \mathbb{Z}, the set of all quadratic residues (perfect squares) has natural density 0, since the number of such residues up to x is at most \sqrt{x} + 1 = O(\sqrt{x}). For general n > 1, the number of quadratic residues n is multiplicative and can be computed as the product of the numbers the prime power factors of n, by the : an a is a quadratic residue n if and only if it is a quadratic residue each dividing n. For n = p^k with p an odd prime, there are \phi(p^k)/2 = p^{k-1}(p-1)/2 quadratic residues coprime to p, plus additional residues divisible by p whose p-adic valuations are even and satisfy quadratic residue conditions lower powers; a for the total in this case, as well as for powers of 2, is given by Stangl (1996). For square-free n, the quadratic residues coprime to n number \phi(n)/2^{\omega(n)}, where \omega(n) is the number of distinct prime factors of n, so the proportion in (\mathbb{Z}/n\mathbb{Z})^* is $2^{-\omega(n)}, which is $1/2 when n is prime and decreases with more prime factors. As an illustration, the quadratic residues modulo 12 (where $12 = 2^2 \times 3) are $0, 1, 4, 9, totaling 4 out of 12 elements.

Quadratic Reciprocity Law

The law of quadratic reciprocity provides a fundamental relation between the Legendre symbols \left( \frac{p}{q} \right) and \left( \frac{q}{p} \right) for distinct primes p and q. It states that \left( \frac{p}{q} \right) \left( \frac{q}{p} \right) = (-1)^{\frac{p-1}{2} \cdot \frac{q-1}{2}}. This equality holds because the exponent \frac{p-1}{2} \cdot \frac{q-1}{2} is even when at least one of p or q is congruent to 1 4, making the symbols equal, and odd otherwise, making them negatives of each other. Two supplementary laws extend the reciprocity to the cases of -1 and 2. For an odd prime p, \left( \frac{-1}{p} \right) = (-1)^{\frac{p-1}{2}}, which equals 1 if p \equiv 1 \pmod{4} and -1 if p \equiv 3 \pmod{4}. Similarly, \left( \frac{2}{p} \right) = (-1)^{\frac{p^2 - 1}{8}}, which equals 1 if p \equiv \pm 1 \pmod{8} and -1 if p \equiv \pm 3 \pmod{8}. These laws enable an efficient algorithm to compute the \left( \frac{a}{p} \right) for odd prime p and a not divisible by p. First, reduce a p to obtain $0 < b < p. If b = 0, the symbol is 0; otherwise, factor out squares from b (which do not change the symbol) until reaching a square-free kernel. Then, apply the supplementary laws if the kernel is -1 or 2 times an odd integer. For an odd prime factor q of the kernel, use reciprocity to swap: \left( \frac{q}{p} \right) = \left( \frac{p}{q} \right) (-1)^{\frac{p-1}{2} \cdot \frac{q-1}{2}}, reducing to a smaller denominator, and recurse until the denominator is small enough to evaluate directly (e.g., by checking if the numerator is a square modulo the small prime). For example, to determine if 3 is a quadratic residue modulo 11, compute \left( \frac{3}{11} \right). Both 3 and 11 are odd primes congruent to 3 modulo 4, so the exponent \frac{3-1}{2} \cdot \frac{11-1}{2} = 1 \cdot 5 = 5 is odd. Thus, \left( \frac{3}{11} \right) = -\left( \frac{11}{3} \right). Now, $11 \equiv 2 \pmod{3}, so \left( \frac{11}{3} \right) = \left( \frac{2}{3} \right). Using the supplementary law, \left( \frac{2}{3} \right) = (-1)^{\frac{9-1}{8}} = (-1)^1 = -1. Therefore, \left( \frac{3}{11} \right) = -(-1) = 1, confirming 3 is a quadratic residue modulo 11. Proofs of quadratic reciprocity typically rely on advanced techniques. An elementary proof uses induction on the primes combined with , which counts the number of negative residues in certain arithmetic progressions to evaluate the symbol. Alternatively, Eisenstein's geometric proof interprets the symbol via lattice points in a circle, showing the reciprocity through area counts and symmetries. A more analytic approach employs , defined as G = \sum_{k=1}^{p-1} \left( \frac{k}{p} \right) e^{2\pi i k / p}, whose magnitude squared equals p and whose evaluation leads to the reciprocity relation via properties of these sums over finite fields; full details appear in advanced texts. The quadratic reciprocity law generalizes to the Jacobi symbol \left( \frac{a}{n} \right), defined for odd positive integer n > 1 and integer a coprime to n as the product of Legendre symbols over the prime factors of n. For distinct odd positive coprime integers m and n, the same reciprocity formula holds: \left( \frac{m}{n} \right) \left( \frac{n}{m} \right) = (-1)^{\frac{m-1}{2} \cdot \frac{n-1}{2}}, along with analogous supplementary laws for -1 and 2, allowing efficient computation without factoring n. Note that the Jacobi symbol equals 1 does not imply a is a quadratic residue modulo n, but equals -1 does imply it is not.

Character Sums and Bounds

Character sums involving the quadratic character provide powerful analytic tools for investigating the of quadratic residues a prime p. The , a central object in this context, is defined as S(h) = \sum_{k=1}^{p-1} \left( \frac{k}{p} \right) e^{2\pi i k h / p}, where \left( \frac{\cdot}{p} \right) denotes the . For h \not\equiv 0 \pmod{p}, the magnitude satisfies |S(h)| = \sqrt{p}. This exact evaluation, first established by Gauss and extended in modern treatments, underpins many estimates on residue patterns and enables the derivation of explicit formulas for related L-functions. Incomplete sums, which truncate the full sum over a residue system, reveal the statistical behavior of quadratic residues. The Pólya–Vinogradov inequality offers a key bound: for any non-principal \chi modulo q and positive integer N, \left| \sum_{n=1}^N \chi(n) \right| \ll \sqrt{q} \log q. When applied to the quadratic \chi(n) = \left( \frac{n}{p} \right) modulo an odd prime p, this inequality controls the oscillation of partial sums and implies non-trivial limits on how residues deviate from uniformity. These bounds directly inform the distribution of quadratic residues in short . For instance, the number of quadratic residues modulo p in an interval [1, N] (with N < p) is \frac{N}{2} + O(\sqrt{p} \log p), measuring the discrepancy from the expected uniform proportion of \frac{1}{2}. Similar error terms arise in more general arithmetic progressions or intervals of length proportional to \sqrt{p}, where the Pólya–Vinogradov estimate ensures the residues are asymptotically balanced, up to the specified error. This has implications for detecting patterns in residue sequences and approximating the indicator function of residues via Fourier analysis. Dirichlet introduced trigonometric expressions for the Legendre symbol, providing a bridge to analytic continuations. One such formula relates weighted sums involving the symbol to cotangent terms, as in \sum_{k=1}^{p-1} \left( \frac{k}{p} \right) k = -\sqrt{p} \sum_{k=1}^{p-1} \left( \frac{k}{p} \right) \cot\left( \frac{\pi k}{p} \right) for primes p \equiv 3 \pmod{4}, with analogous hyperbolic forms using logarithms of sines for broader evaluations. These representations, though intricate, facilitate derivations of special values in number theory, such as class numbers, while keeping the focus on finite sums for computational insight. Overall, character sums and their bounds quantify error terms in the distribution of quadratic residues, ensuring that deviations from randomness remain controlled by \sqrt{p} \log p in typical settings. This framework extends to incomplete sums over arbitrary ranges, where the error in approximating the residue count by \frac{1}{2} times the interval length is governed by the same order, enabling precise asymptotic analyses without relying on deeper conjectures like the Riemann Hypothesis for quadratic characters.

Least Quadratic Non-Residue

In number theory, for an odd prime p, the least quadratic non-residue modulo p is defined as the smallest positive integer g such that the Legendre symbol \left( \frac{g}{p} \right) = -1. This g is always a prime number, since any composite quadratic non-residue would imply a smaller prime non-residue as a factor. Representative examples illustrate this concept: for p = 7, the quadratic residues modulo 7 are 0, 1, 2, and 4, so the least non-residue is g = 3; for p = 11, the residues are 0, 1, 3, 4, 5, and 9, yielding g = 2; similarly, for p = 13, the residues are 0, 1, 3, 4, 9, 10, and 12, again with g = 2. Unconditionally, the best known upper bound on g is due to D. A. Burgess, who proved in 1957 that g = O\left( p^{1/(4\sqrt{e}) + \epsilon} \right) for any \epsilon > 0, where $1/(4\sqrt{e}) \approx 0.1516; this improves upon I. M. Vinogradov's earlier 1919 result of O\left( p^{1/\sqrt{e} + \epsilon} \right) with $1/\sqrt{e} \approx 0.6065. Burgess's bound relies on estimates for short Dirichlet character sums modulo p, amplifying trivial bounds via the completion method. Under the Generalized Riemann Hypothesis (GRH), stronger conditional bounds exist. N. C. Ankeny showed in that g \ll (\log p)^2 \log \log p, later refined by E. Bach in 1990 to the explicit form g < 2 (\log p)^2 for all odd primes p, and further to g \leq (\log p)^2 by Y. Lamzouri, X. Li, and K. Soundararajan in 2015. These GRH bounds highlight the expected logarithmic scale of g, contrasting with the subpolynomial growth under the hypothesis. The least quadratic non-residue is connected to Artin's conjecture on primitive roots, as every primitive root modulo p must be a quadratic non-residue (since the quadratic residues form a proper subgroup of index 2 in (\mathbb{Z}/p\mathbb{Z})^\times), implying that the least primitive root is at least g. Under GRH, both quantities are bounded by O((\log p)^2), and C. Hooley's 1967 proof of Artin's conjecture relies on similar analytic techniques involving L-functions.

Quadratic Excess

The quadratic excess provides a measure of the imbalance in the distribution of quadratic residues and non-residues within short intervals modulo an odd prime p. For an interval [1, N] with $1 \leq N < p, it is defined as the absolute difference E = |R - NR|, where R is the number of quadratic residues in the interval and NR is the number of quadratic non-residues, so that R + NR = N. This quantity can be expressed precisely as E = \left| \sum_{k=1}^N \left( \frac{k}{p} \right) \right|, where \left( \frac{\cdot}{p} \right) denotes the Legendre symbol. Davenport established results on the typical size of this excess across different intervals. Specifically, the average excess over all intervals of fixed length N is small, with the root-mean-square value bounded by O(\sqrt{N}), reflecting the expected random-like behavior of the in short segments. For a uniform bound applicable to any single interval, the yields E = O(\sqrt{p \log p}), ensuring the deviation does not exceed this order regardless of N. The quadratic excess is intrinsically linked to incomplete sums of the quadratic character \left( \frac{\cdot}{p} \right), as the expression above shows; bounds on such sums, including those from the , directly control the excess and reveal deviations from uniformity in residue distribution. These estimates relate to broader character sum techniques, such as the , which provides non-trivial bounds on partial sums of non-principal characters. Studies of quadratic excess aid in sieve theory by quantifying local density imbalances of residues, which helps refine sifting processes for sets defined by quadratic conditions and improves estimates of residue patterns in arithmetic progressions or related structures. For illustration, consider the interval [1, \lfloor p/2 \rfloor], where the excess is the classical quadratic excess E(p). For p=7, the quadratic residues modulo 7 are 1, 2, and 4; in [1,3], there are 2 residues (1,2) and 1 non-residue (3), so E=1. For p=11, residues are 1, 3, 4, 5, and 9; in [1,5], there are 4 residues (1,3,4,5) and 1 non-residue (2), so E=3. For p=13, residues are 1, 3, 4, 9, 10, and 12; in [1,6], there are 3 residues (1,3,4) and 3 non-residues, so E=0.

Computational Methods

Square Roots Modulo Primes and Prime Powers

Computing square roots modulo an odd prime p, where the input a is a quadratic residue modulo p, can be done efficiently using specialized algorithms. For primes p \equiv 3 \pmod{4}, a simple and direct method exists: the square roots are given by \pm a^{(p+1)/4} \pmod{p}. This formula arises from properties of the multiplicative group modulo p and , and it requires only a single modular exponentiation. For the general case of odd primes p \equiv 1 \pmod{4}, or more broadly for any odd prime, the Tonelli-Shanks algorithm provides a systematic approach to extract the roots. Developed by building on earlier work, the algorithm proceeds as follows: first, factor p-1 = 2^s q where q is odd; then, identify a quadratic non-residue z modulo p (e.g., by testing small values until the Legendre symbol (z/p) = -1); set c = z^q \pmod{p}, r = a^{(q+1)/2} \pmod{p}, and t = a^q \pmod{p}; iteratively adjust r and t over s-1 steps by finding the smallest i such that t^{2^i} \equiv 1 \pmod{p}, computing a correction factor b = c^{2^{s-i-1}} \pmod{p}, and updating r \leftarrow r b \pmod{p} and t \leftarrow t b^2 \pmod{p}. The final r satisfies r^2 \equiv a \pmod{p}, and the other root is -r \pmod{p}. This method relies on discrete logarithm-like steps within the 2-Sylow subgroup of the multiplicative group. (Note: Direct link to Shanks' original proceedings unavailable; cited via standard reference.) For the prime p = 2, the cases are straightforward and trivial for small powers. Modulo 2, the quadratic residues are 0 and 1, with roots 0 and 1 (or -1 ≡ 1). Modulo 4, the residues are 0 and 1, with roots \pm 0 \equiv 0 and \pm 1 \equiv 1,3. Modulo 8, the residues are 0, 1, and 4, with roots 0 for 0, \pm 1 \equiv 1,7 for 1, and \pm 2 \equiv 2,6 for 4. Higher powers of 2 require lifting, as detailed below. To extend solutions from modulo p to modulo p^k for k > 1, provides an iterative lifting procedure, applicable when the derivative condition holds. Suppose x_0^2 \equiv a \pmod{p} with $2x_0 \not\equiv [0](/page/0) \pmod{p} (true for odd p and nonzero residues). Define f(x) = x^2 - a; then, for each step from m to m+1 (up to k), solve x_{m+1} = x_m - f(x_m) \cdot (f'(x_m))^{-1} \pmod{p^{m+1}}, where f'(x) = 2x and the inverse exists modulo p by the initial condition. This Newton-Raphson-like iteration converges quadratically, lifting the root uniquely under the nonsingularity assumption. For p=2 and k \geq 3, lifting starts from modulo 8 solutions, but requires care since f'(x_0) \equiv [0](/page/0) \pmod{2}; in such cases, multiple lifts (up to four for odd residues) are possible, and the process adjusts for higher valuation. As an example, consider computing a square root of 4 7 (p=7 \equiv [3](/page/3) \pmod{4}): $4^{(7+1)/4} = 4^2 = 16 \equiv 2 \pmod{7}, and the roots are \pm 2 \equiv 2,5 \pmod{7}, since $2^2 = 4 and $5^2 = 25 \equiv 4 \pmod{7}. For lifting to 9 (p=[3](/page/3), k=2): start with \sqrt{1} \equiv 1 \pmod{3}; then x_1 = 1 - (1^2 - 1) \cdot (2 \cdot 1)^{-1} \equiv 1 \pmod{9} (trivially, since exact), but checking, roots are 1 and 8 9, as $8^2 = 64 \equiv 1 \pmod{9}; the other lift from -1 \equiv 2 \pmod{3} yields 8. The Tonelli-Shanks algorithm runs in O(\log^2 p) time using fast exponentiation for the modular operations, assuming a quadratic non-residue is found efficiently (e.g., in expected O(\log p) trials). The simple case for p \equiv 3 \pmod{4} is faster at O(\log p) exponentiations. Lifting via Hensel's lemma requires O(\log k \cdot \log p) steps, each with modular arithmetic of size O(p^k), but for fixed k or using fast methods, it remains polynomial in \log p.

Square Roots Modulo Composites

When the prime factorization of a composite modulus n = \prod p_i^{k_i} is known, square roots of a quadratic residue a modulo n can be computed by first finding the square roots modulo each prime power factor p_i^{k_i} and then combining them using the (CRT). Methods for computing square roots modulo prime powers, such as Tonelli-Shanks for odd primes or explicit formulas for powers of 2, are applied separately to each component. The then lifts these local solutions to global solutions modulo n, as the rings \mathbb{Z}/p_i^{k_i}\mathbb{Z} are pairwise coprime. For example, consider solving x^2 \equiv 4 \pmod{15}, where n=15=3 \times 5. Modulo 3, $4 \equiv 1 \pmod{3}, so the roots are x \equiv \pm 1 \pmod{3} (i.e., 1 and 2). Modulo 5, $4 \equiv 4 \pmod{5}, so the roots are x \equiv \pm 2 \pmod{5} (i.e., 2 and 3). The four combinations are then solved via CRT:
  • x \equiv 1 \pmod{3}, x \equiv 2 \pmod{5} yields x \equiv 7 \pmod{15};
  • x \equiv 1 \pmod{3}, x \equiv 3 \pmod{5} yields x \equiv 13 \pmod{15};
  • x \equiv 2 \pmod{3}, x \equiv 2 \pmod{5} yields x \equiv 2 \pmod{15};
  • x \equiv 2 \pmod{3}, x \equiv 3 \pmod{5} yields x \equiv 8 \pmod{15}.
    All satisfy x^2 \equiv 4 \pmod{15}.
If a is a quadratic residue modulo n = 2^e \prod_{i=1}^r p_i^{k_i} with r distinct odd primes and e \geq 0, the number of square roots is $2^r when e \leq 1, $2^{r+1} when e=2, and $2^{r+2} when e \geq 3, assuming the conditions for existence hold modulo the 2-power. This follows from the decomposition, where each odd contributes exactly 2 roots, and the 2-power contributes 1, 2, or 4 roots depending on e. Computing square roots modulo a composite n without its factorization is significantly harder and is computationally equivalent to integer factorization in difficulty. No efficient general algorithm exists for this case, as it would imply an efficient factoring method. In the context of the Rabin cryptosystem, where n = pq for distinct odd primes p and q, a ciphertext corresponds to four possible plaintext roots modulo n, but distinguishing the correct one among them without the factorization is infeasible, underpinning the system's security. For semiprimes n = pq with partial information (e.g., approximate factors), specialized algorithms like those involving expansions of related rationals may aid in partial recovery, but they generally reduce to full problems and lack efficiency for large n.

Complexity Considerations

Determining quadratic residuosity modulo a prime p is computationally efficient. Euler's criterion states that a is a quadratic residue modulo p if and only if a^{(p-1)/2} \equiv 1 \pmod{p}, which can be verified using in O(\log p) arithmetic operations assuming constant-time . Alternatively, the (a/p) can be computed in O(\log p) time via the law of , reducing the problem to a series of simpler evaluations. Finding square roots modulo a prime is also feasible in polynomial time. The deterministic Tonelli-Shanks algorithm computes such roots for odd primes in O(\log^2 p) time, relying on exponentiations and a search for a quadratic non-residue. Probabilistic variants, such as randomized selections in extensions of Tonelli-Shanks, achieve expected running times faster than O(\log^2 p) under certain conditions, though deterministic guarantees remain O(\log^2 p). Modulo a composite n, the situation changes dramatically. Deciding quadratic residuosity for a with Jacobi symbol (a/n) = 1 is believed to be computationally hard, with no known polynomial-time without the factorization of n; this forms the quadratic residuosity assumption underlying several . Computing square roots modulo n is equivalent in hardness to : an oracle for square roots allows factoring n in polynomial time by exploiting the four possible roots and gcd computations, and conversely, roots can be found efficiently once factors are known via the . Quantum computing alters this landscape. factors composite integers in polynomial time on a quantum computer, thereby enabling efficient solution of both residuosity testing and extraction modulo composites by first obtaining the prime factors. Space and time tradeoffs arise in related factoring tasks. For instance, for factoring polynomials over finite fields \mathbb{F}_p leverages computations of quadratic residues and non-residues (via algorithms like Tonelli-Shanks) to identify irreducible factors, balancing probabilistic root-finding steps against deterministic verification for overall polynomial-time performance. Under standard cryptographic assumptions, such as the hardness of factoring, no efficient classical algorithm exists for square root finding or residuosity testing modulo composites without factorization, establishing conditional lower bounds of superpolynomial time.

Applications

Primality Testing and Factorization

Quadratic residues play a central role in probabilistic primality testing through algorithms that leverage Euler's criterion, which states that for a prime p and integer a not divisible by p, a^{(p-1)/2} \equiv \left( \frac{a}{p} \right) \pmod{p}, where \left( \frac{a}{p} \right) is the Legendre symbol indicating quadratic residuosity. The Solovay-Strassen test, introduced in 1977, extends this to composite moduli using the Jacobi symbol \left( \frac{a}{n} \right) in place of the Legendre symbol; for a candidate prime n, it selects random bases a coprime to n and verifies whether \left( \frac{a}{n} \right) \equiv a^{(n-1)/2} \pmod{n}. If the equality fails for any a, n is composite; if it holds for k independent random a, the probability that a composite n passes is at most $1/2^k. This test efficiently detects compositeness by exploiting mismatches in quadratic residuosity properties, with each trial requiring computation of the Jacobi symbol and modular exponentiation. The Miller-Rabin primality test, developed in the late 1970s and early 1980s, builds on similar principles but focuses on strong pseudoprimes rather than direct quadratic residuosity checks, avoiding the need for computations by testing stronger conditions derived from the same Euler criterion framework. While Solovay-Strassen relies explicitly on quadratic symbols to witness compositeness, Miller-Rabin uses iterative squaring to check if a^{2^s d} \equiv \pm 1 \pmod{n} for decomposed exponents, where failures indicate non-residuosity-like behavior signaling compositeness. This relation highlights how quadratic residue concepts underpin both tests, though Miller-Rabin's emphasis on strong witnesses makes it faster and more widely implemented in practice. In , quadratic residues facilitate sieving techniques in methods like Dixon's algorithm and the , where they help identify values modulo small primes to construct relations for factoring. Dixon's method, proposed in 1981, generates random squares x_i^2 \pmod{n} and sieves for partial smoothness by checking quadratic residuosity modulo a factor base of small primes, retaining those x_i^2 - n that factor completely over the base to form a whose yields nontrivial factors of n. The , refined by Pomerance in 1984, improves this by evaluating a (x + \lfloor \sqrt{n} \rfloor )^2 - n over a sieving interval, using Legendre symbols \left( \frac{f(p)}{p} \right) for small primes p in the factor base to locate candidate values efficiently, leading to relations that solve for factors via linear . These approaches exploit the density of quadratic residues (roughly half the nonzero residues modulo a prime) to accelerate the search for differences of squares. The (CFRAC), advanced as a computational method in 1975, also incorporates quadratic residuosity in generating and verifying relations from approximations to \sqrt{n}. It derives convergents from the continued fraction expansion of \sqrt{n}, yielding equations of the form x^2 - k n = y^2 for small k, and sieves the left-hand sides for by testing residuosity factor base primes to confirm factorizations, accumulating relations until a reveals a factor of n. In all these factoring methods, quadratic residuosity serves as a sieve to eliminate non-smooth candidates quickly, enhancing efficiency for large n. More broadly, in primality contexts, a failure of \left( \frac{a}{n} \right) \not\equiv a^{(n-1)/2} \pmod{n} for composite n and coprime a directly proves compositeness, as this congruence holds universally for primes by Euler's criterion.

Cryptography

The Rabin cryptosystem, introduced by in , is a public-key encryption scheme that leverages the computational difficulty of extracting square modulo a . In this system, the public key consists of a modulus n = pq where p and q are large distinct primes congruent to 3 modulo 4, and encryption of a message m (padded with redundancy to disambiguate roots) is performed by computing the c = m^2 \mod n. Decryption involves computing the four possible square roots modulo n using the after finding roots modulo p and q separately, which requires knowledge of the private factors; the redundancy ensures the correct root can be identified probabilistically with high probability. The security of the Rabin cryptosystem is equivalent to the hardness of , as an oracle for decryption would allow efficient factoring. The residuosity assumption posits that, given a composite n = pq with p and q large primes, it is computationally infeasible to distinguish quadratic residues from non-residues modulo n without knowing the factors. This assumption underpins several , including the Goldwasser-Micali proposed in 1982, which achieves by encrypting each bit of the message using random quadratic residues or non-residues modulo n, with the determining the bit value during decryption. Building on similar ideas, the Blum-Goldwasser from 1985 provides probabilistic encryption for multi-bit messages by generating a pseudorandom bit stream via iterated squaring in the of quadratic residues modulo n (using primes p, q \equiv 3 \mod 4), which is XORed with the ; security relies on the intractability of predicting the least significant bits of such iterates, tied to the quadratic residuosity problem. The , introduced in 1998, extends these concepts to higher powers by using a n = p^2 q where p is a large prime and q is another prime, focusing on the difficulty of deciding membership in the of order p. maps a m (in the range 0 to p-1) to c = g^m \cdot h^r \pmod{n} for a base g of order p p^2, public h = g^p \pmod{n}, and random r, allowing decryption via the private key p but remaining secure under the decisional p-th residuosity assumption without it. For digital signatures, schemes based on the quadratic residuosity assumption include the Goldwasser-Micali-Rivest construction from 1988, which uses zero-knowledge proofs of residuosity (inspired by earlier work on interactive proofs) combined with the to produce signatures robust against adaptive chosen-message attacks, with security reducible to the assumption. Despite their provable security foundations, these quadratic residue-based systems face significant post-quantum threats, as enables efficient quantum solution of the problem, breaking the underlying hardness assumptions for , Goldwasser-Micali, Blum-Goldwasser, and related schemes. The Okamoto-Uchiyama scheme is similarly vulnerable due to its reliance on factorization modulo prime powers. Efforts to adapt these for post-quantum settings have been limited, with most focus shifting to lattice-based or hash-based alternatives.

Other Fields

In acoustics, quadratic residue diffusers are structures designed to scatter sound waves evenly in rooms, such as concert halls, by using sequences derived from quadratic residues modulo a . These diffusers, pioneered by Manfred R. Schroeder in 1975, consist of wells or panels whose depths follow a quadratic residue sequence, ensuring uniform diffusion across a wide range while minimizing specular reflections. For example, a prime like yields the sequence 0, 1, 4, 2 (corresponding to the quadratic residues modulo 7), which determines the well depths to achieve effective sound . In graph theory, quadratic residues form the basis for Paley graphs, which are constructed over the \mathbb{F}_q where q is a congruent to 1 4; the vertices are the field , and an edge connects x and y if x - y is a nonzero quadratic residue. Introduced by Raymond Paley in 1933 as part of his work on orthogonal matrices, these graphs are strongly regular, meaning they have constant degrees and uniform adjacency properties among non-adjacent vertices, which facilitates their analysis in . Paley graphs also appear in due to their symmetric structure and connection to Hadamard matrices. Quadratic residue codes represent a class of cyclic error-correcting codes defined over finite fields, where the generator polynomial's roots correspond to quadratic residues a prime p. For codes with length p \equiv 3 \pmod{4}, these codes are constructed by evaluating the quadratic residues to form the code's parity-check matrix, yielding self-dual codes with good minimum distance properties; notable examples include the Golay code of length 23, which corrects up to 3 errors. Such codes, studied extensively since the , are applied in data transmission for their efficiency in detecting and correcting errors without excessive redundancy. In and , quadratic residues underpin the construction of Paley and related , where for a prime q \equiv 3 \pmod{4}, the directs an from x to y in \mathbb{Z}/q\mathbb{Z} if y - x is a quadratic residue, producing a regular with balanced out-degrees. These structures support combinatorial , such as difference sets, where the set of quadratic residues modulo p forms a (p, (p-1)/2, (p-5)/4)-difference set, enabling the creation of balanced incomplete block used in experimental and statistical modeling. Additionally, random walks on graphs defined by quadratic residue adjacencies, like Paley graphs, model processes and exhibit properties tied to the of residues, aiding in probabilistic .

Examples and Tables

Small Moduli Examples

The only nonzero residue class coprime to 2 is , which is a quadratic residue since $1^2 \equiv 1 \pmod{2}. Modulo , the quadratic residues are , obtained from $1^2 \equiv 1 \pmod{3} and $2^2 \equiv 1 \pmod{3}, while 2 is a non-residue. For modulus 4, the nonzero residues coprime to 4 are and 3. The quadratic residue is , as $1^2 \equiv 1 \pmod{4} and $3^2 \equiv 1 \pmod{4}; 3 is a non-residue. (Note: squares modulo 4 are 0 and 1, but only coprime nonzero a qualify as quadratic residues per the definition.) Modulo 5, the quadratic residues are 1 and 4, computed from the nonzero squares $1^2 \equiv 1, $2^2 \equiv 4, $3^2 \equiv 4, and $4^2 \equiv 1 \pmod{5}; the non-residues are 2 and 3. This can be verified using the Legendre symbol, where \left( \frac{2}{5} \right) = -1, confirming that 2 is a non-residue modulo 5. For modulus 7, the quadratic residues are 1, 2, and 4, arising from $1^2 \equiv 1, $2^2 \equiv 4, $3^2 \equiv 2, $4^2 \equiv 2, $5^2 \equiv 4, and $6^2 \equiv 1 \pmod{7}; the non-residues are 3, 5, and 6. Modulo 11, a prime, the quadratic residues are 1, 3, 4, 5, and 9, with corresponding square roots as follows: 1 from \pm1^2 (1 and 10); 3 from \pm5^2 (5 and 6); 4 from \pm2^2 (2 and 9); 5 from \pm4^2 (4 and 7); 9 from \pm3^2 (3 and 8). The non-residues are 2, 6, 7, 8, and 10. For modulus 13, another prime, the quadratic residues are 1, 3, 4, 9, 10, and 12, with square roots: 1 from \pm1^2 (1 and 12); 3 from \pm4^2 (4 and 9); 4 from \pm2^2 (2 and 11); 9 from \pm3^2 (3 and 10); 10 from \pm6^2 (6 and 7); 12 from \pm5^2 (5 and 8). The non-residues are 2, 5, 6, 7, 8, and 11. A notable pattern in these examples for prime moduli is the symmetry between residues x and p - x, since (p - x)^2 \equiv x^2 \pmod{p}, pairing square roots and producing symmetric residue sets. Additionally, for odd primes p, there are exactly (p-1)/2 quadratic residues among the p-1 nonzero residue classes, yielding a density of exactly 1/2, as observed in the cases modulo 5 (2 out of 4), 7 (3 out of 6), 11 (5 out of 10), and 13 (6 out of 12).

Table of Quadratic Residues

The following table lists the nonzero quadratic residues (sorted in increasing order), the quadratic non-residues (the remaining nonzero residues coprime to p), and the least quadratic non-residue for odd primes p up to 31. Each nonzero quadratic residue modulo a prime p has exactly two square roots, which are additive inverses modulo p.
Prime pNonzero Quadratic ResiduesQuadratic Non-ResiduesLeast Non-Residue
3122
51, 42, 32
71, 2, 43, 5, 63
111, 3, 4, 5, 92, 6, 7, 8, 102
131, 3, 4, 9, 10, 122, 5, 6, 7, 8, 112
171, 2, 4, 8, 9, 13, 15, 163, 5, 6, 7, 10, 11, 12, 143
191, 4, 5, 6, 7, 9, 11, 16, 172, 3, 8, 10, 12, 13, 14, 15, 182
231, 2, 3, 4, 6, 8, 9, 12, 13, 16, 185, 7, 10, 11, 14, 15, 19, 20, 21, 225
291, 4, 5, 6, 7, 9, 13, 16, 20, 22, 23, 24, 25, 282, 3, 8, 10, 11, 12, 14, 15, 17, 18, 19, 21, 26, 272
311, 2, 4, 5, 7, 8, 9, 10, 14, 15, 16, 18, 19, 20, 25, 283, 6, 11, 12, 13, 17, 21, 22, 23, 24, 26, 27, 29, 303
The least quadratic non-residues are given by the sequence A053760 in the OEIS. For composite moduli, quadratic residues are the nonzero values a coprime to n for which the congruence x^2 \equiv a \pmod{n} has a solution; the number of solutions per residue depends on the prime factorization of n. The table below provides these for selected small composites up to 15.
Modulus nNonzero Coprime Quadratic Residues
61
81
91, 4, 7
101, 9
121
151, 4
A notable pattern in the prime table is that -1 \equiv p-1 \pmod{p} appears as a quadratic residue precisely when p \equiv 1 \pmod{4} (e.g., for p=5,13,17,29), but not when p \equiv 3 \pmod{4} (e.g., for p=3,7,11,19,23,31). These tables cover small moduli for reference; for larger primes, the full list of (p-1)/2 nonzero quadratic residues can be computed but is not exhaustive here.

References

  1. [1]
    [PDF] 7 Quadratic Residues - UCI Mathematics
    A quadratic residue (QR) modulo p is a non-zero residue a where x² ≡ a (mod p) has a solution. Otherwise, it is a quadratic non-residue (QNR).
  2. [2]
    5.4: Introduction to Quadratic Residues and Nonresidues
    Jul 7, 2021 · An integer a is a quadratic residue of m if ( a , m ) = 1 and the congruence x 2 ≡ a ⁡ ( m ⁢ o ⁢ d m ) is solvable. If the congruence ...
  3. [3]
    Quadratic Residue -- from Wolfram MathWorld
    If there is an integer 0<x<p such that x^2=q (mod p), ie, the congruence (1) has a solution, then q is said to be a quadratic residue (mod p).
  4. [4]
    1.5: Congruences
    ### Summary on Quadratic Residues Forming a Subgroup of Index 2
  5. [5]
    Legendre Symbol -- from Wolfram MathWorld
    The Legendre symbol is a number theoretic function (a/p) which is defined to be equal to +/-1 depending on whether a is a quadratic residue modulo p.
  6. [6]
    Euler's Criterion -- from Wolfram MathWorld
    For p an odd prime and a positive integer a which is not a multiple of p, a^((p-1)/2)=(a/p) (mod p), where (a|p) is the Legendre symbol.
  7. [7]
    Jacobi Symbol -- from Wolfram MathWorld
    (The Legendre symbol is equal to +/-1 depending on whether n is a quadratic residue modulo m.) Therefore, when m is a prime, the Jacobi symbol reduces to ...
  8. [8]
    Kronecker Symbol -- from Wolfram MathWorld
    The Kronecker symbol is an extension of the Jacobi symbol (n/m) to all integers. It is variously written as (n/m) or (n/m).
  9. [9]
    [PDF] Quadratic residue patterns modulo a prime - Keith Conrad
    Among the nonzero numbers in Fp, half are squares and half are nonsquares. The former are called quadratic residues and the latter are called quadratic.
  10. [10]
    [PDF] Chapter 9 Quadratic Residues
    Proposition 9.2. Suppose p is an odd prime. Then the quadratic residues coprime to p form a subgroup of (Z/p)× of index 2. then kerθ = {±1}, imθ = Q.Missing: nonzero | Show results with:nonzero
  11. [11]
    Number Theory - Quadratic Residues
    We say a is a quadratic residue if there exists some x such that x 2 = a . Otherwise a is a quadratic nonresidue. Efficiently distinguishing a quadratic residue ...
  12. [12]
    Number Theory - Gauss' Lemma
    Theorem (Gauss' Lemma): Let p be an odd prime, q be an integer coprime to p. Take the least residues of , that is, reduce them to integers in.
  13. [13]
    [PDF] Square roots modulo a prime
    The solution to x2 ≡ a is thus x ≡ ±vk. To construct these sequences we need some more information. Let b be a quadratic nonresidue modulo p and ...
  14. [14]
    [PDF] Chapter 10 Quadratic Residues
    Definition 10.1. We say that a ∈ Z is a quadratic residue mod n if there exists b ∈ Z such that a ≡ b2 mod n. If there is no such b we say that a is a ...
  15. [15]
    [PDF] Chapter 9 Quadratic Residues
    Suppose p is an odd prime; and suppose a ∈ Z is coprime to p. Then a is a quadratic residue modulo pe (where e ≥ 1) if and only if it is quadratic residue ...
  16. [16]
    [PDF] Contents 5 Squares and Quadratic Reciprocity - Evan Dummit
    If p is an odd prime and u is a primitive root modulo p, then a is a quadratic residue modulo p if and only if a ≡ u2k (mod p) for some integer k. ◦ In other ...
  17. [17]
    [PDF] Odd Quadratic Residues modulo powers of 2 Write up 2017
    With these 3 theorem, all of the quadratic residues modulo powers of 2 and the solutions to x2 ≡ mod 2k can be determined inductively starting ...
  18. [18]
    Quadratic Congruences with Composite Moduli - IMOMath
    Let p be odd and n ≥ 2 . Number a is a quadratic residue modulo p n if and only if either p ∤ a and a is a quadratic residue modulo p , or p 2 ∣ a and a / p 2 ...
  19. [19]
    Pell's equation - MacTutor History of Mathematics
    So Brahmagupta was able to show that if he could find ( a , b ) (a, b) (a,b) which "nearly" satisfied Pell's equation in the sense that n a 2 + k = b 2 na^{2} + ...Missing: residues | Show results with:residues
  20. [20]
    Pierre Fermat - Biography
    ### Summary of Fermat's Contributions to Number Theory (Squares and Modulo Primes)
  21. [21]
    Earliest Known Uses of Some of the Words of Mathematics (Q)
    The term QUADRATIC RESIDUE was introduced by Euler in a paper of 1754-55 (Kline, page 611). The term non-residue is found in a paper by Euler of 1758-59 ...
  22. [22]
    Leonhard Euler - Biography
    ### Summary of Euler's Contributions to Quadratic Residues and Number Theory Related to Squares Modulo Primes
  23. [23]
    Adrien-Marie Legendre - Biography - MacTutor
    The 1785 paper on number theory contains a number of important results such as the law of quadratic reciprocity for residues and the results that every ...
  24. [24]
    Quadratic Reciprocity Theorem -- from Wolfram MathWorld
    The quadratic reciprocity theorem states that the congruences x^2=q (mod p) x^2=p (mod q) are both solvable or both unsolvable unless both p and q leave the ...
  25. [25]
    Disquisitiones arithmeticae : Gauss, Carl Friedrich, 1777-1855
    Aug 11, 2018 · Publication date: 1801. Topics: Number theory. Publisher: Lipsiae : In commiss. apud Gerh. Fleischer, jun. Collection: smithsonian.Missing: quadratic reciprocity
  26. [26]
    3.12 Quadratic Reciprocity - Whitman College
    The Quadratic Reciprocity Theorem was proved first by Gauss, in the early 1800s, and reproved many times thereafter (at least eight times by Gauss).Missing: 1754 | Show results with:1754
  27. [27]
    [PDF] Quadratic reciprocity: Eisenstein's proof
    This is a proof due to Eisenstein in 1845. It is one of those short cunning proofs that work by apparent magic. Recall Gauss's lemma.
  28. [28]
    Gotthold Eisenstein (1823 - 1852) - Biography - MacTutor
    Gotthold Eisenstein worked on a variety of topics including quadratic and cubic forms, the reciprocity theorem for cubic residues, quadratic partition of prime ...
  29. [29]
    Counting Squares in Z<sub>n</sub> - jstor
    We will adopt the following notation: q(n) = the number of quadratic residues in zn, and s(n) = the number of squares in Zn. For example, q(8) = 1 since x2 = 1 ...
  30. [30]
    [PDF] quadratic-residues.pdf
    Aug 4, 2019 · It changed the course of number theory, collecting scattered results into a unified theory. We'll look at some important computational ...
  31. [31]
    [PDF] EVALUATION OF THE QUADRATIC GAUSS SUM
    May 17, 2017 · For further reading on Gauss sums, we refer the reader to [2] and [3]. In this article, we focus on the quadratic Gauss sum, namely,. G(2) = n−1.
  32. [32]
    [PDF] the p ´olya–vinogradov inequality
    This brief paper gives an overview of the Pólya–Vinogradov inequality. The back- ground, mathematical and historical, of the inequality is discussed. An ...
  33. [33]
    [PDF] The distribution of quadratic and higher residues, (1)
    In this paper we discuss some of the many problems that can be propounded concerning the distribution of the quadratic residues and non-.
  34. [34]
    [PDF] Elementary Trigonometric Sums related to Quadratic Residues - arXiv
    May 18, 2012 · k=1 (kp)cot kπp . (20). This is a consequence of the more general formula, referred to as “Lebesgue's formula” in. Dickson's ...
  35. [35]
    [PDF] The smallest quadratic nonresidue modulo a prime - Paul Pollack
    Aug 29, 2012 · Definition. For each odd prime p, let n2(p) denote the least quadratic nonresidue modulo p. For example, n2(5) = 2 and n2(7) = 3. For ...
  36. [36]
    The least prime quadratic nonresidue in a prescribed residue class ...
    We derive a suitable bound from the following explicit version of the Pólya–Vinogradov inequality due to Frolenkov and Soundararajan (see [5, Theorem 2]).<|separator|>
  37. [37]
    [PDF] The distribution of quadratic residues and non-residues
    This implies, in particular, that the maximum number of consecutive quadratic residues or non-residues (modp) is O(pi+i)for large p. Previously it was knownf ...
  38. [38]
    The least quadratic nonresidue, and the square root barrier - Terry Tao
    Aug 18, 2009 · In this post I would like to indicate a classical example of this type of amplification trick, namely Burgess's bound on short character sums.
  39. [39]
    [PDF] The least quadratic non-residue - Lake Forest College
    Jul 18, 2019 · Our goal in this section is to prove the Pólya–Vinogradov inequality for prime moduli. Remark 3.1. Let p be an odd prime. Choose a primitive ...
  40. [40]
    [PDF] least quadratic non-residue and least primitive root - UBC Math
    Thus not only will we get a bound on where the least quadratic residue is, but also bounds on the number of primitive roots modulo a prime in any interval.
  41. [41]
    [PDF] Quadratic Residues and Non-Residues - arXiv
    Oct 21, 2016 · If p is an odd prime, an integer z is a quadratic residue (respectively, a quadratic non-residue) of p if there is (respectively, is not) an ...
  42. [42]
    [PDF] Introduction to Analytic Number Theory Incomplete character sums I
    Incomplete character sums I: The Davenport-Erd˝os bound, and the distribution of short character sums. Finally, we consider upper bounds on exponential sum ...
  43. [43]
    None
    Summary of each segment:
  44. [44]
    [PDF] HENSEL'S LEMMA 1. Introduction In the p-adic integers ...
    Hensel's Lemma gives conditions under which a root of a polynomial mod p lifts to a root in Zp, such as the polynomial X2 − 7 with p = 3.
  45. [45]
    [PDF] Basic number theory fact sheet Part II: Arithmetic modulo composites
    (b) Use the Chinese Remainder Theorem to construct a ∈ ZN such that a = a1 mod p ... Computing the square root of a QR in ZN . This is provably as hard as ...
  46. [46]
    [PDF] 1 More on Chinese Remaindering 2 Quadratic Residues - UMD CS
    Define QZN as the set of quadratic residues in Ζ* N. Note that the theorem above implies. that exactly 1/4 of the elements in Ζ* N are quadratic residues; or \ ...
  47. [47]
    [PDF] Lecture 11 - Basic Number Theory. - cs.Princeton
    Oct 20, 2005 · ... distinct primes, then every number a that has square root mod n, has at least 4 square roots. Indeed, if n is of this form then n = pq for ...
  48. [48]
    [PDF] Notes on Primality Testing And Public Key Cryptography Part 1
    Now, we can determine the exact number of square roots of unity modulo n. Theorem 5.2. For any natural number n > 1, if the prime factorization of n is n ...
  49. [49]
    [PDF] The Rabin Cryptosystem 1 Introduction 2 Computing Modular ...
    Apr 12, 2015 · That is, to compute square root of a modulo an integer. N − pq of known factorization : • Compute ap = [a mod p] and aq = [a mod q]. • Using the ...
  50. [50]
    [PDF] Computing Square Roots Faster than the Tonelli-Shanks/Bernstein ...
    This constitutes the first phase of the algorithm. Let T denote the total number of multiplications and squarings required for this computation. We analyse ...Missing: original source
  51. [51]
    [PDF] The Jacobi Symbol Problem for Quadratic Congruences and ...
    We divide the quadratic residues into two classes according to the Jacobi symbol of their roots, which in turn induces a partition into two classes of the ...
  52. [52]
    [PDF] Z ; hardness of squaring modulo a composite; and RSA
    Z∗n is the set of values in Zn relatively prime to n. Computing square roots modulo n is hard, and RSA uses a power e, not 2, similar to modular squaring.
  53. [53]
    [PDF] Tonelli-Shanks Algorithm and Berlekamp's Algorithm - MIT
    We can easily generalize Tonelli-Shanks to find the 𝑘-th root of a given 𝑘-th power residue 𝑛 ∈ 𝔽𝑝, for small 𝑘.Missing: paper | Show results with:paper
  54. [54]
    [PDF] The Quadratic Sieve Factoring Algorithm - Dartmouth Mathematics
    The quadratic sieve algorithm is currently the method of choice to factor very large composite numbers with no small factors. In the hands of the Sandia ...
  55. [55]
    [PDF] MIT/LCS/TR-212 - Digitalized Signatures and Public Key Functions
    DeMillo editors,. Academic Press New York, 1978/. Rabin, M.O., Probabilistic algorithms in finite fields, submitted for publication. Rivest, R.L., Shamir A., ...
  56. [56]
    [PDF] A New Generalisation of the Goldwasser-Micali Cryptosystem Based ...
    We present a novel public key encryption scheme that en- ables users to exchange many bits messages by means of at least two large prime numbers in a Goldwasser ...
  57. [57]
  58. [58]
    [PDF] Minimum Tournaments with the Strong Sk-Property and Implications ...
    May 17, 2022 · For instance, the quadratic-residue tournaments induce an infinite family of concept classes all of which can be taught with a single example in ...
  59. [59]
    Quadratic residues and the combinatorics of sign multiplication
    If q is a fixed nonnegative integer, then there exists infinitely many primes p such that S contains exactly q quadratic residues of p.
  60. [60]
    Quadratic Equations and Residues Modulo N - Expii
    Thus the quadratic residues mod 4 are 0 and 1. If that doesn't answer how quadratic residues can be useful let me give you an example from the jmo. This is ...<|control11|><|separator|>
  61. [61]
    A053760 - OEIS
    Assuming the Generalized Riemann Hypothesis, Montgomery proved a(n) << (log p(n))^2, meaning that there is a constant c such that |a(n)| <= c*(log p(n))^2.