Movatterモバイル変換


[0]ホーム

URL:


Jump to content
WikipediaThe Free Encyclopedia
Search

Quadratic residue

Page semi-protected
From Wikipedia, the free encyclopedia
Integer that is a perfect square modulo some integer

Innumber theory, anintegerq is aquadratic residuemodulon if it iscongruent to aperfect square modulon; that is, if there exists an integerx such that

x2q(modn).{\displaystyle x^{2}\equiv q{\pmod {n}}.}

Otherwise,q is aquadratic nonresidue modulon.

Quadratic residues are used in applications ranging fromacoustical engineering tocryptography and thefactoring of large numbers.

History, conventions, and elementary facts

Fermat,Euler,Lagrange,Legendre, and other number theorists of the 17th and 18th centuries established theorems[1] and formed conjectures[2] about quadratic residues, but the first systematic treatment is § IV ofGauss'sDisquisitiones Arithmeticae (1801). Article 95 introduces the terminology "quadratic residue" and "quadratic nonresidue", and says that if the context makes it clear, the adjective "quadratic" may be dropped.

For a givenn, a list of the quadratic residues modulon may be obtained by simply squaring all the numbers 0, 1, ...,n − 1. Sinceab (modn) impliesa2b2 (modn), any other quadratic residue is congruent (modn) to some in the obtained list. But the obtained list is not composed of mutually incongruent quadratic residues (mod n) only. Sincea2≡(na)2 (modn), the list obtained by squaring all numbers in the list 1, 2, ...,n − 1 (or in the list 0, 1, ...,n) is symmetric (modn) around its midpoint, hence it is actually only needed to square all the numbers in the list 0, 1, ...,{\displaystyle \lfloor }n/2{\displaystyle \rfloor }. The list so obtained may still contain mutually congruent numbers (modn). Thus, the number of mutually noncongruent quadratic residues modulon cannot exceedn/2 + 1 (n even) or (n + 1)/2 (n odd).[3]

The product of two residues is always a residue.

Prime modulus

Modulo 2, every integer is a quadratic residue.

Modulo an oddprime numberp there are (p + 1)/2 residues (including 0) and (p − 1)/2 nonresidues, byEuler's criterion. In this case, it is customary to consider 0 as a special case and work within themultiplicative group of nonzero elements of thefield(Z/pZ){\displaystyle (\mathbb {Z} /p\mathbb {Z} )}. In other words, every congruence class except zero modulop has a multiplicative inverse. This is not true for composite moduli.[4]

Following this convention, the multiplicative inverse of a residue is a residue, and the inverse of a nonresidue is a nonresidue.[5]

Following this convention, modulo an odd prime number there is an equal number of residues and nonresidues.[4]

Modulo a prime, the product of two nonresidues is a residue and the product of a nonresidue and a (nonzero) residue is a nonresidue.[5]

The first supplement[6] to thelaw of quadratic reciprocity is that ifp ≡ 1 (mod 4) then −1 is a quadratic residue modulop, and ifp ≡ 3 (mod 4) then −1 is a nonresidue modulop. This implies the following:

Ifp ≡ 1 (mod 4) the negative of a residue modulop is a residue and the negative of a nonresidue is a nonresidue.

Ifp ≡ 3 (mod 4) the negative of a residue modulop is a nonresidue and the negative of a nonresidue is a residue.

Prime power modulus

All odd squares are ≡ 1 (mod 8) and thus also ≡ 1 (mod 4). Ifa is an odd number andm = 8, 16, or some higher power of 2, thena is a residue modulom if and only ifa ≡ 1 (mod 8).[7]

For example, mod (32) the odd squares are

12 ≡ 152 ≡ 1
32 ≡ 132 ≡ 9
52 ≡ 112 ≡ 25
72 ≡ 92 ≡ 49 ≡ 17

and the even ones are

02 ≡ 82 ≡ 162 ≡ 0
22 ≡ 62≡ 102 ≡ 142≡ 4
42 ≡ 122 ≡ 16.

So a nonzero number is a residue mod 8, 16, etc., if and only if it is of the form 4k(8n + 1).

A numbera relatively prime to an odd primep is a residue modulo any power ofp if and only if it is a residue modulop.[8]

If the modulus ispn,

thenpka
is a residue modulopn ifkn
is a nonresidue modulopn ifk <n is odd
is a residue modulopn ifk <n is even anda is a residue
is a nonresidue modulopn ifk <n is even anda is a nonresidue.[9]

Notice that the rules are different for powers of two and powers of odd primes.

Modulo an odd prime powern =pk, the products of residues and nonresidues relatively prime top obey the same rules as they do modp;p is a nonresidue, and in general all the residues and nonresidues obey the same rules, except that the products will be zero if the power ofp in the product ≥n.

Modulo 8, the product of the nonresidues 3 and 5 is the nonresidue 7, and likewise for permutations of 3, 5 and 7. In fact, the multiplicative group of the non-residues and 1 form theKlein four-group.

Composite modulus not a prime power

The basic fact in this case is

ifa is a residue modulon, thena is a residue modulopk forevery prime power dividingn.
ifa is a nonresidue modulon, thena is a nonresidue modulopk forat least one prime power dividingn.

Modulo a composite number, the product of two residues is a residue. The product of a residue and a nonresidue may be a residue, a nonresidue, or zero.

For example, from the table for modulus 6  1, 2,3,4, 5 (residues inbold).

The product of the residue 3 and the nonresidue 5 is the residue 3, whereas the product of the residue 4 and the nonresidue 2 is the nonresidue 2.

Also, the product of two nonresidues may be either a residue, a nonresidue, or zero.

For example, from the table for modulus 15  1, 2, 3,4, 5,6, 7, 8,9,10, 11, 12, 13, 14 (residues inbold).

The product of the nonresidues 2 and 8 is the residue 1, whereas the product of the nonresidues 2 and 7 is the nonresidue 14.

This phenomenon can best be described using the vocabulary of abstract algebra. The congruence classes relatively prime to the modulus are agroup under multiplication, called thegroup of units of thering(Z/nZ){\displaystyle (\mathbb {Z} /n\mathbb {Z} )}, and the squares are asubgroup of it. Different nonresidues may belong to differentcosets, and there is no simple rule that predicts which one their product will be in. Modulo a prime, there is only the subgroup of squares and a single coset.

The fact that, e.g., modulo 15 the product of the nonresidues 3 and 5, or of the nonresidue 5 and the residue 9, or the two residues 9 and 10 are all zero comes from working in the full ring(Z/nZ){\displaystyle (\mathbb {Z} /n\mathbb {Z} )}, which haszero divisors for compositen.

For this reason some authors[10] add to the definition that a quadratic residuea must not only be a square but must also berelatively prime to the modulusn. (a is coprime ton if and only ifa2 is coprime ton.)

Although it makes things tidier, this article does not insist that residues must be coprime to the modulus.

Notations

Gauss[11] usedR andN to denote residuosity and non-residuosity, respectively;

for example,2 R 7 and5 N 7, or1 R 8 and3 N 8.

Although this notation is compact and convenient for some purposes,[12][13] a more useful notation is theLegendre symbol, also called thequadratic character, which is defined for all integersa and positive oddprime numbersp as

(ap)={0 if p divides a+1 if aRp and p does not divide a1 if aNp and p does not divide a{\displaystyle \left({\frac {a}{p}}\right)={\begin{cases}\;\;\,0&{\text{ if }}p{\text{ divides }}a\\+1&{\text{ if }}a\operatorname {R} p{\text{ and }}p{\text{ does not divide }}a\\-1&{\text{ if }}a\operatorname {N} p{\text{ and }}p{\text{ does not divide }}a\end{cases}}}

There are two reasons why numbers ≡ 0 (modp) are treated specially. As we have seen, it makes many formulas and theorems easier to state. The other (related) reason is that the quadratic character is ahomomorphism from themultiplicative group of nonzero congruence classes modulop to thecomplex numbers under multiplication. Setting(npp)=0{\displaystyle ({\tfrac {np}{p}})=0} allows itsdomain to be extended to the multiplicativesemigroup of all the integers.[14]

One advantage of this notation over Gauss's is that the Legendre symbol is a function that can be used in formulas.[15] It can also easily be generalized tocubic, quartic and higher power residues.[16]

There is a generalization of the Legendre symbol for composite values ofp, theJacobi symbol, but its properties are not as simple: ifm is composite and the Jacobi symbol(am)=1,{\displaystyle ({\tfrac {a}{m}})=-1,} thena Nm, and ifa Rm then(am)=1,{\displaystyle ({\tfrac {a}{m}})=1,} but if(am)=1{\displaystyle ({\tfrac {a}{m}})=1} we do not know whethera Rm ora Nm. For example:(215)=1{\displaystyle ({\tfrac {2}{15}})=1} and(415)=1{\displaystyle ({\tfrac {4}{15}})=1}, but2 N 15 and4 R 15. Ifm is prime, the Jacobi and Legendre symbols agree.

Distribution of quadratic residues

Although quadratic residues appear to occur in a rather random pattern modulon, and this has been exploited in suchapplications asacoustics andcryptography, their distribution also exhibits some striking regularities.

UsingDirichlet's theorem on primes inarithmetic progressions, thelaw of quadratic reciprocity, and theChinese remainder theorem (CRT) it is easy to see that for anyM > 0 there are primesp such that the numbers 1, 2, ...,M are all residues modulop.

For example, ifp ≡ 1 (mod 8), (mod 12), (mod 5) and (mod 28), then by the law of quadratic reciprocity 2, 3, 5, and 7 will all be residues modulop, and thus all numbers 1–10 will be. The CRT says that this is the same asp ≡ 1 (mod 840), and Dirichlet's theorem says there are an infinite number of primes of this form. 2521 is the smallest, and indeed 12 ≡ 1, 10462 ≡ 2, 1232 ≡ 3, 22 ≡ 4, 6432 ≡ 5, 872 ≡ 6, 6682 ≡ 7, 4292 ≡ 8, 32 ≡ 9, and 5292 ≡ 10 (mod 2521).

Dirichlet's formulas

The first of these regularities stems fromPeter Gustav Lejeune Dirichlet's work (in the 1830s) on theanalytic formula for theclass number of binaryquadratic forms.[17] Letq be a prime number,s a complex variable, and define aDirichlet L-function as

L(s)=n=1(nq)ns.{\displaystyle L(s)=\sum _{n=1}^{\infty }\left({\frac {n}{q}}\right)n^{-s}.}

Dirichlet showed that ifq ≡ 3 (mod 4), then

L(1)=πqn=1q1nq(nq)>0.{\displaystyle L(1)=-{\frac {\pi }{\sqrt {q}}}\sum _{n=1}^{q-1}{\frac {n}{q}}\left({\frac {n}{q}}\right)>0.}

Therefore, in this case (primeq ≡ 3 (mod 4)), the sum of the quadratic residues minus the sum of the nonresidues in the range 1, 2, ...,q − 1 is a negative number.

For example, modulo 11,

1, 2,3,4,5, 6, 7, 8,9, 10 (residues inbold)
1 + 4 + 9 + 5 + 3 = 22, 2 + 6 + 7 + 8 + 10 = 33, and the difference is −11.

In fact the difference will always be an odd multiple ofq ifq > 3.[18] In contrast, for primeq ≡ 1 (mod 4), the sum of the quadratic residues minus the sum of the nonresidues in the range 1, 2, ...,q − 1 is zero, implying that both sums equalq(q1)4{\displaystyle {\frac {q(q-1)}{4}}}.[citation needed]

Dirichlet also proved that for primeq ≡ 3 (mod 4),

L(1)=π(2(2q))qn=1q12(nq)>0.{\displaystyle L(1)={\frac {\pi }{\left(2-\left({\frac {2}{q}}\right)\right)\!{\sqrt {q}}}}\sum _{n=1}^{\frac {q-1}{2}}\left({\frac {n}{q}}\right)>0.}

This implies that there are more quadratic residues than nonresidues among the numbers 1, 2, ..., (q − 1)/2.

For example, modulo 11 there are four residues less than 6 (namely 1, 3, 4, and 5), but only one nonresidue (2).

An intriguing fact about these two theorems is that all known proofs rely on analysis; no-one has ever published a simple or direct proof of either statement.[19]

Law of quadratic reciprocity

Main article:quadratic reciprocity

Ifp andq are odd primes, then:

((p is a quadratic residue modq) if and only if (q is a quadratic residue modp)) if and only if (at least one ofp andq is congruent to 1 mod 4).

That is:

(pq)(qp)=(1)p12q12{\displaystyle \left({\frac {p}{q}}\right)\left({\frac {q}{p}}\right)=(-1)^{{\frac {p-1}{2}}\cdot {\frac {q-1}{2}}}}

where(pq){\displaystyle \left({\frac {p}{q}}\right)} is theLegendre symbol.

Thus, for numbersa and odd primesp that don't dividea:

aa is a quadratic residue modp if and only ifaa is a quadratic residue modp if and only if
1(every primep)−1p ≡ 1 (mod 4)
2p ≡ 1, 7 (mod 8)−2p ≡ 1, 3 (mod 8)
3p ≡ 1, 11 (mod 12)−3p ≡ 1 (mod 3)
4(every primep)−4p ≡ 1 (mod 4)
5p ≡ 1, 4 (mod 5)−5p ≡ 1, 3, 7, 9 (mod 20)
6p ≡ 1, 5, 19, 23 (mod 24)−6p ≡ 1, 5, 7, 11 (mod 24)
7p ≡ 1, 3, 9, 19, 25, 27 (mod 28)−7p ≡ 1, 2, 4 (mod 7)
8p ≡ 1, 7 (mod 8)−8p ≡ 1, 3 (mod 8)
9(every primep)−9p ≡ 1 (mod 4)
10p ≡ 1, 3, 9, 13, 27, 31, 37, 39 (mod 40)−10p ≡ 1, 7, 9, 11, 13, 19, 23, 37 (mod 40)
11p ≡ 1, 5, 7, 9, 19, 25, 35, 37, 39, 43 (mod 44)−11p ≡ 1, 3, 4, 5, 9 (mod 11)
12p ≡ 1, 11 (mod 12)−12p ≡ 1 (mod 3)

Pairs of residues and nonresidues

Modulo a primep, the number of pairsn,n + 1 wheren Rp andn + 1 Rp, orn Np andn + 1 Rp, etc., are almost equal. More precisely,[20][21] letp be an odd prime. Fori,j = 0, 1 define the sets

Aij={k{1,2,,p2}:(kp)=(1)i(k+1p)=(1)j},{\displaystyle A_{ij}=\left\{k\in \{1,2,\dots ,p-2\}:\left({\frac {k}{p}}\right)=(-1)^{i}\land \left({\frac {k+1}{p}}\right)=(-1)^{j}\right\},}

and let

αij=|Aij|.{\displaystyle \alpha _{ij}=|A_{ij}|.}

That is,

α00 is the number of residues that are followed by a residue,
α01 is the number of residues that are followed by a nonresidue,
α10 is the number of nonresidues that are followed by a residue, and
α11 is the number of nonresidues that are followed by a nonresidue.

Then ifp ≡ 1 (mod 4)

α00=p54,α01=α10=α11=p14{\displaystyle \alpha _{00}={\frac {p-5}{4}},\;\alpha _{01}=\alpha _{10}=\alpha _{11}={\frac {p-1}{4}}}

and ifp ≡ 3 (mod 4)

α01=p+14,α00=α10=α11=p34.{\displaystyle \alpha _{01}={\frac {p+1}{4}},\;\alpha _{00}=\alpha _{10}=\alpha _{11}={\frac {p-3}{4}}.}

For example: (residues inbold)

Modulo 17

1,2, 3,4, 5, 6, 7,8,9, 10, 11, 12,13, 14,15,16
A00 = {1,8,15},
A01 = {2,4,9,13},
A10 = {3,7,12,14},
A11 = {5,6,10,11}.

Modulo 19

1, 2, 3,4,5,6,7, 8,9, 10,11, 12, 13, 14, 15,16,17, 18
A00 = {4,5,6,16},
A01 = {1,7,9,11,17},
A10 = {3,8,10,15},
A11 = {2,12,13,14}.

Gauss (1828)[22] introduced this sort of counting when he proved that ifp ≡ 1 (mod 4) thenx4 ≡ 2 (modp) can be solved if and only ifp = a2 + 64 b2.

The Pólya–Vinogradov inequality

The values of(ap){\displaystyle ({\tfrac {a}{p}})} for consecutive values ofa mimic a random variable like acoin flip.[23] Specifically,Pólya andVinogradov proved[24] (independently) in 1918 that for any nonprincipalDirichlet character χ(n) moduloq and any integersM andN,

|n=M+1M+Nχ(n)|=O(qlogq),{\displaystyle \left|\sum _{n=M+1}^{M+N}\chi (n)\right|=O\left({\sqrt {q}}\log q\right),}

inbig O notation. Setting

χ(n)=(nq),{\displaystyle \chi (n)=\left({\frac {n}{q}}\right),}

this shows that the number of quadratic residues moduloq in any interval of lengthN is

12N+O(qlogq).{\displaystyle {\frac {1}{2}}N+O({\sqrt {q}}\log q).}

It is easy[25] to prove that

|n=M+1M+N(nq)|<qlogq.{\displaystyle \left|\sum _{n=M+1}^{M+N}\left({\frac {n}{q}}\right)\right|<{\sqrt {q}}\log q.}

In fact,[26]

|n=M+1M+N(nq)|<4π2qlogq+0.41q+0.61.{\displaystyle \left|\sum _{n=M+1}^{M+N}\left({\frac {n}{q}}\right)\right|<{\frac {4}{\pi ^{2}}}{\sqrt {q}}\log q+0.41{\sqrt {q}}+0.61.}

Montgomery andVaughan improved this in 1977, showing that, if thegeneralized Riemann hypothesis is true then

|n=M+1M+Nχ(n)|=O(qloglogq).{\displaystyle \left|\sum _{n=M+1}^{M+N}\chi (n)\right|=O\left({\sqrt {q}}\log \log q\right).}

This result cannot be substantially improved, forSchur had proved in 1918 that

maxN|n=1N(nq)|>12πq{\displaystyle \max _{N}\left|\sum _{n=1}^{N}\left({\frac {n}{q}}\right)\right|>{\frac {1}{2\pi }}{\sqrt {q}}}

andPaley had proved in 1932 that

maxN|n=1N(dn)|>17dloglogd{\displaystyle \max _{N}\left|\sum _{n=1}^{N}\left({\frac {d}{n}}\right)\right|>{\frac {1}{7}}{\sqrt {d}}\log \log d}

for infinitely manyd > 0.

Least quadratic non-residue

The least quadratic residue modp is clearly 1. The question of the magnitude of the least quadratic non-residuen(p) is more subtle, but it is always prime, with 7 appearing for the first time at 71.

The Pólya–Vinogradov inequality above gives O(p logp).

The best unconditional estimate isn(p) ≪pθ for any θ>1/4e, obtained by estimates of Burgess oncharacter sums.[27]

Assuming theGeneralised Riemann hypothesis, Ankeny obtainedn(p) ≪ (logp)2.[28]

Linnik showed that the number ofp less thanX such thatn(p) > Xε is bounded by a constant depending on ε.[27]

The least quadratic non-residues modp for odd primesp are:

2, 2, 3, 2, 2, 3, 2, 5, 2, 3, 2, ... (sequenceA053760 in theOEIS)

Quadratic excess

Letp be an odd prime. Thequadratic excessE(p) is the number of quadratic residues on the range (0,p/2) minus the number in the range (p/2,p) (sequenceA178153 in theOEIS). Forp congruent to 1 mod 4, the excess is zero, since −1 is a quadratic residue and the residues are symmetric underrpr. Forp congruent to 3 mod 4, the excessE is always positive.[29]

Complexity of finding square roots

That is, given a numbera and a modulusn, how hard is it

  1. to tell whether anx solvingx2a (modn) exists
  2. assuming one does exist, to calculate it?

An important difference between prime and composite moduli shows up here. Modulo a primep, a quadratic residuea has 1 + (a|p) roots (i.e. zero ifa Np, one ifa ≡ 0 (modp), or two ifa Rp and gcd(a,p) = 1.)

In general if a composite modulusn is written as a product of powers of distinct primes, and there aren1 roots modulo the first one,n2 mod the second, ..., there will ben1n2... roots modulon.

The theoretical way solutions modulo the prime powers are combined to make solutions modulon is called theChinese remainder theorem; it can be implemented with an efficient algorithm.[30]

For example:

Solve x2 ≡ 6 (mod 15).
x2 ≡ 6 (mod 3) has one solution, 0; x2 ≡ 6 (mod 5) has two, 1 and 4.
and there are two solutions modulo 15, namely 6 and 9.
Solve x2 ≡ 4 (mod 15).
x2 ≡ 4 (mod 3) has two solutions, 1 and 2; x2 ≡ 4 (mod 5) has two, 2 and 3.
and there are four solutions modulo 15, namely 2, 7, 8, and 13.
Solve x2 ≡ 7 (mod 15).
x2 ≡ 7 (mod 3) has two solutions, 1 and 2; x2 ≡ 7 (mod 5) has no solutions.
and there are no solutions modulo 15.

Prime or prime power modulus

First off, if the modulusn is prime theLegendre symbol(an){\displaystyle \left({\frac {a}{n}}\right)} can bequickly computed using a variation ofEuclid's algorithm[31] or theEuler's criterion. If it is −1 there is no solution.Secondly, assuming that(an)=1{\displaystyle \left({\frac {a}{n}}\right)=1}, ifn ≡ 3 (mod 4),Lagrange found that the solutions are given by

x±a(n+1)/4(modn),{\displaystyle x\equiv \pm \;a^{(n+1)/4}{\pmod {n}},}

andLegendre found a similar solution[32] ifn ≡ 5 (mod 8):

x{±a(n+3)/8(modn) if a is a quartic residue modulo n±a(n+3)/82(n1)/4(modn) if a is a quartic non-residue modulo n{\displaystyle x\equiv {\begin{cases}\pm \;a^{(n+3)/8}{\pmod {n}}&{\text{ if }}a{\text{ is a quartic residue modulo }}n\\\pm \;a^{(n+3)/8}2^{(n-1)/4}{\pmod {n}}&{\text{ if }}a{\text{ is a quartic non-residue modulo }}n\end{cases}}}

For primen ≡ 1 (mod 8), however, there is no known formula.Tonelli[33] (in 1891) andCipolla[34] found efficient algorithms that work for all prime moduli. Both algorithms require finding a quadratic nonresidue modulon, and there is no efficient deterministic algorithm known for doing that. But since half the numbers between 1 andn are nonresidues, picking numbersx at random and calculating the Legendre symbol(xn){\displaystyle \left({\frac {x}{n}}\right)} until a nonresidue is found will quickly produce one. A slight variant of this algorithm is theTonelli–Shanks algorithm.

If the modulusn is aprime powern =pe, a solution may be found modulop and "lifted" to a solution modulon usingHensel's lemma or an algorithm of Gauss.[8]

Composite modulus

If the modulusn has been factored into prime powers the solution was discussed above.

Ifn is not congruent to 2 modulo 4 and theKronecker symbol(an)=1{\displaystyle \left({\tfrac {a}{n}}\right)=-1} then there is no solution; ifn is congruent to 2 modulo 4 and(an/2)=1{\displaystyle \left({\tfrac {a}{n/2}}\right)=-1}, then there is also no solution. Ifn is not congruent to 2 modulo 4 and(an)=1{\displaystyle \left({\tfrac {a}{n}}\right)=1}, orn is congruent to 2 modulo 4 and(an/2)=1{\displaystyle \left({\tfrac {a}{n/2}}\right)=1}, there may or may not be one.

If the complete factorization ofn is not known, and(an)=1{\displaystyle \left({\tfrac {a}{n}}\right)=1} andn is not congruent to 2 modulo 4, orn is congruent to 2 modulo 4 and(an/2)=1{\displaystyle \left({\tfrac {a}{n/2}}\right)=1}, the problem is known to be equivalent tointeger factorization ofn (i.e. an efficient solution to either problem could be used to solve the other efficiently).

The above discussion indicates how knowing the factors ofn allows us to find the roots efficiently. Say there were an efficient algorithm for finding square roots modulo a composite number. The articlecongruence of squares discusses how finding two numbers x and y wherex2y2 (modn) andx ≠ ±y suffices to factorizen efficiently. Generate a random number, square it modulon, and have the efficient square root algorithm find a root. Repeat until it returns a number not equal to the one we originally squared (or its negative modulon), then follow the algorithm described in congruence of squares. The efficiency of the factoring algorithm depends on the exact characteristics of the root-finder (e.g. does it return all roots? just the smallest one? a random one?), but it will be efficient.[35]

Determining whethera is a quadratic residue or nonresidue modulon (denoteda Rn ora Nn) can be done efficiently for primen by computing the Legendre symbol. However, for compositen, this forms thequadratic residuosity problem, which is not known to be ashard as factorization, but is assumed to be quite hard.

On the other hand, if we want to know if there is a solution forx less than some given limitc, this problem isNP-complete;[36] however, this is afixed-parameter tractable problem, wherec is the parameter.

In general, to determine ifa is a quadratic residue modulo compositen, one can use the following theorem:[37]

Letn > 1, andgcd(a,n) = 1. Thenx2a (modn) is solvable if and only if:

Note: This theorem essentially requires that the factorization ofn is known. Also notice that ifgcd(a,n) =m, then the congruence can be reduced toa/mx2/m (modn/m), but then this takes the problem away from quadratic residues (unlessm is a square).

The number of quadratic residues

The list of the number of quadratic residues modulon, forn = 1, 2, 3 ..., looks like:

1, 2, 2, 2, 3, 4, 4, 3, 4, 6, 6, 4, 7, 8, 6, ... (sequenceA000224 in theOEIS)

A formula to count the number of squares modulon is given by Stangl.[38]

Applications of quadratic residues

Acoustics

Sound diffusers have been based on number-theoretic concepts such asprimitive roots and quadratic residues.[39]

Graph theory

Paley graphs are dense undirected graphs, one for each primep ≡ 1 (mod 4), that form an infinite family ofconference graphs, which yield an infinite family ofsymmetricconference matrices.

Paley digraphs are directed analogs of Paley graphs, one for eachp ≡ 3 (mod 4), that yieldantisymmetric conference matrices.

The construction of these graphs uses quadratic residues.

Cryptography

The fact that finding a square root of a number modulo a large compositen is equivalent to factoring (which is widely believed to be ahard problem) has been used for constructingcryptographic schemes such as theRabin cryptosystem and theoblivious transfer. Thequadratic residuosity problem is the basis for theGoldwasser-Micali cryptosystem.

Thediscrete logarithm is a similar problem that is also used in cryptography.

Primality testing

Euler's criterion is a formula for the Legendre symbol (a|p) wherep is prime. Ifp is composite the formula may or may not compute (a|p) correctly. TheSolovay–Strassen primality test for whether a given numbern is prime or composite picks a randoma and computes (a|n) using a modification of Euclid's algorithm,[40] and also using Euler's criterion.[41] If the results disagree,n is composite; if they agree,n may be composite or prime. For a compositen at least 1/2 the values ofa in the range 2, 3, ...,n − 1 will return "n is composite"; for primen none will. If, after using many different values ofa,n has not been proved composite it is called a "probable prime".

TheMiller–Rabin primality test is based on the same principles. There is a deterministic version of it, but the proof that it works depends on thegeneralized Riemann hypothesis; the output from this test is "n is definitely composite" or "eithern is prime or the GRH is false". If the second output ever occurs for a compositen, then the GRH would be false, which would have implications through many branches of mathematics.

Integer factorization

In § VI of theDisquisitiones Arithmeticae[42] Gauss discusses two factoring algorithms that use quadratic residues and thelaw of quadratic reciprocity.

Several modern factorization algorithms (includingDixon's algorithm, thecontinued fraction method, thequadratic sieve, and thenumber field sieve) generate small quadratic residues (modulo the number being factorized) in an attempt to find acongruence of squares which will yield a factorization. The number field sieve is the fastest general-purpose factorization algorithm known.

Table of quadratic residues

The following table (sequenceA096008 in theOEIS) lists the quadratic residues mod 1 to 75 (ared number means it is not coprime ton). (For the quadratic residues coprime ton, seeOEISA096103, and for nonzero quadratic residues, seeOEISA046071.)

nquadratic residues modnnquadratic residues modnnquadratic residues modn
10260, 1, 3,4, 9,10,12,13,14,16, 17,22, 23, 25510, 1, 4,9, 13,15, 16,18, 19,21, 25,30,33,34,36,42, 43, 49
20, 1270, 1, 4, 7,9, 10, 13, 16, 19, 22, 25520, 1,4, 9,12,13,16, 17, 25, 29,36,40,48, 49
30, 1280, 1,4,8, 9,16,21, 25530, 1, 4, 6, 7, 9, 10, 11, 13, 15, 16, 17, 24, 25, 28, 29, 36, 37, 38, 40, 42, 43, 44, 46, 47, 49, 52
40, 1290, 1, 4, 5, 6, 7, 9, 13, 16, 20, 22, 23, 24, 25, 28540, 1,4, 7,9,10, 13,16, 19,22, 25,27,28, 31,34,36, 37,40, 43,46, 49,52
50, 1, 4300, 1,4,6,9,10,15,16, 19,21,24,25550, 1, 4,5, 9,11, 14,15, 16,20,25, 26, 31, 34, 36,44,45, 49
60, 1,3,4310, 1, 2, 4, 5, 7, 8, 9, 10, 14, 16, 18, 19, 20, 25, 28560, 1,4,8, 9,16, 25,28,32,36,44,49
70, 1, 2, 4320, 1,4, 9,16, 17, 25570, 1, 4,6, 7,9, 16,19,24, 25, 28,30,36,39,42, 43,45, 49,54, 55
80, 1,4330, 1,3, 4,9,12,15, 16,22, 25,27, 31580, 1,4, 5,6, 7, 9, 13,16,20,22, 23,24, 25,28,29,30, 33,34, 35,36,38,42, 45, 49, 51,52, 53,54, 57
90, 1, 4, 7340, 1,2,4,8, 9, 13, 15,16,17,18, 19, 21, 25,26,30,32, 33590, 1, 3, 4, 5, 7, 9, 12, 15, 16, 17, 19, 20, 21, 22, 25, 26, 27, 28, 29, 35, 36, 41, 45, 46, 48, 49, 51, 53, 57
100, 1,4,5,6, 9350, 1, 4, 9, 11,14,15, 16,21,25, 29,30600, 1,4,9,16,21,24,25,36,40,45, 49
110, 1, 3, 4, 5, 9360, 1,4,9, 13,16, 25,28610, 1, 3, 4, 5, 9, 12, 13, 14, 15, 16, 19, 20, 22, 25, 27, 34, 36, 39, 41, 42, 45, 46, 47, 48, 49, 52, 56, 57, 58, 60
120, 1,4,9370, 1, 3, 4, 7, 9, 10, 11, 12, 16, 21, 25, 26, 27, 28, 30, 33, 34, 36620, 1,2,4, 5, 7,8, 9,10,14,16,18, 19,20, 25,28,31,32, 33, 35,36,38, 39,40, 41, 45, 47, 49,50, 51,56, 59
130, 1, 3, 4, 9, 10, 12380, 1,4, 5,6, 7, 9, 11,16, 17,19,20, 23,24, 25,26,28,30, 35,36630, 1, 4,7,9, 16,18, 22, 25,28,36, 37, 43, 46,49, 58
140, 1,2,4,7,8, 9, 11390, 1,3, 4,9, 10,12,13, 16, 22, 25,27,30,36640, 1,4, 9,16, 17, 25, 33,36, 41, 49, 57
150, 1, 4,6,9,10400, 1,4, 9,16,20,24,25,36650, 1, 4, 9,10, 14, 16,25,26, 29,30,35, 36,39,40, 49, 51,55, 56, 61, 64
160, 1,4, 9410, 1, 2, 4, 5, 8, 9, 10, 16, 18, 20, 21, 23, 25, 31, 32, 33, 36, 37, 39, 40660, 1,3,4,9,12,15,16,22, 25,27, 31,33,34,36, 37,42,45,48, 49,55,58,60,64
170, 1, 2, 4, 8, 9, 13, 15, 16420, 1,4,7,9,15,16,18,21,22, 25,28,30,36, 37,39670, 1, 4, 6, 9, 10, 14, 15, 16, 17, 19, 21, 22, 23, 24, 25, 26, 29, 33, 35, 36, 37, 39, 40, 47, 49, 54, 55, 56, 59, 60, 62, 64, 65
180, 1,4, 7,9,10, 13,16430, 1, 4, 6, 9, 10, 11, 13, 14, 15, 16, 17, 21, 23, 24, 25, 31, 35, 36, 38, 40, 41680, 1,4,8, 9, 13,16,17, 21, 25,32, 33,36, 49,52, 53,60,64
190, 1, 4, 5, 6, 7, 9, 11, 16, 17440, 1,4, 5, 9,12,16,20, 25,33,36, 37690, 1,3, 4,6,9,12, 13, 16,18,24, 25,27, 31,36,39,46,48, 49, 52,54, 55, 58, 64
200, 1,4,5, 9,16450, 1, 4,9,10, 16, 19,25, 31, 34,36,40700, 1,4, 9, 11,14,15,16,21,25, 29,30,35,36, 39,44,46,49,50, 51,56,60,64,65
210, 1, 4,7,9,15, 16,18460, 1,2, 3,4,6,8, 9,12, 13,16,18,23,24, 25,26, 27, 29, 31,32, 35,36, 39, 41710, 1, 2, 3, 4, 5, 6, 8, 9, 10, 12, 15, 16, 18, 19, 20, 24, 25, 27, 29, 30, 32, 36, 37, 38, 40, 43, 45, 48, 49, 50, 54, 57, 58, 60, 64
220, 1, 3,4, 5, 9,11,12,14, 15,16,20470, 1, 2, 3, 4, 6, 7, 8, 9, 12, 14, 16, 17, 18, 21, 24, 25, 27, 28, 32, 34, 36, 37, 42720, 1,4,9,16, 25,28,36,40, 49,52,64
230, 1, 2, 3, 4, 6, 8, 9, 12, 13, 16, 18480, 1,4,9,16, 25,33,36730, 1, 2, 3, 4, 6, 8, 9, 12, 16, 18, 19, 23, 24, 25, 27, 32, 35, 36, 37, 38, 41, 46, 48, 49, 50, 54, 55, 57, 61, 64, 65, 67, 69, 70, 71, 72
240, 1,4,9,12,16490, 1, 2, 4, 8, 9, 11, 15, 16, 18, 22, 23, 25, 29, 30, 32, 36, 37, 39, 43, 44, 46740, 1, 3,4, 7, 9,10, 11,12,16, 21, 25,26, 27,28,30, 33,34,36,37,38,40, 41,44,46, 47,48, 49, 53,58,62, 63,64, 65, 67,70, 71, 73
250, 1, 4, 6, 9, 11, 14, 16, 19, 21, 24500, 1,4,6, 9, 11,14,16, 19, 21,24,25,26, 29, 31,34,36, 39, 41,44,46, 49750, 1, 4,6,9, 16, 19,21,24,25, 31, 34,36,39, 46, 49,51,54, 61, 64,66,69
Quadratic Residues (see alsoA048152,A343720)
x12345678910111213141516171819202122232425
x2149162536496481100121144169196225256289324361400441484529576625
mod 10000000000000000000000000
mod 21010101010101010101010101
mod 31101101101101101101101101
mod 41010101010101010101010101
mod 51441014410144101441014410
mod 61434101434101434101434101
mod 71422410142241014224101422
mod 81410141014101410141014101
mod 91407704101407704101407704
mod 101496569410149656941014965
mod 111495335941014953359410149
mod 121494101494101494101494101
mod 13149312101012394101493121010123941
mod 1414921187811294101492118781129
mod 1514911064461019410149110644610
mod 161490941014909410149094101
mod 171491682151313152816941014916821513
mod 18149167013109101307169410149167013
mod 19149166171175571117616941014916617
mod 20149165169410149165169410149165
mod 211491641571181616181715416941014916
mod 22149163145201512111215205143169410149
mod 23149162133181286681218313216941014
mod 241491611211694101491611211694101
mod 251491601124146021191921061424110169410

See also

Notes

  1. ^Lemmemeyer, Ch. 1
  2. ^Lemmermeyer, pp 6–8, p. 16 ff
  3. ^Gauss, DA, art. 94
  4. ^abGauss, DA, art. 96
  5. ^abGauss, DA, art. 98
  6. ^Gauss, DA, art 111
  7. ^Gauss, DA, art. 103
  8. ^abGauss, DA, art. 101
  9. ^Gauss, DA, art. 102
  10. ^e.g.,Ireland & Rosen 1990, p. 50
  11. ^Gauss, DA, art. 131
  12. ^e.g. Hardy and Wright use it
  13. ^Gauss, DA, art 230 ff.
  14. ^This extension of the domain is necessary for definingL functions.
  15. ^SeeLegendre symbol#Properties of the Legendre symbol for examples
  16. ^Lemmermeyer, pp 111–end
  17. ^Davenport 2000, pp. 8–9, 43–51. These are classical results.
  18. ^Davenport 2000, pp. 49–51, (conjectured byJacobi, proved by Dirichlet)
  19. ^Davenport 2000, p. 9
  20. ^Lemmermeyer, p. 29 ex. 1.22; cf pp. 26–27, Ch. 10
  21. ^Crandall & Pomerance, ex 2.38, pp 106–108
  22. ^Gauss,Theorie der biquadratischen Reste, Erste Abhandlung (pp 511–533 of theUntersuchungen über hohere Arithmetik)
  23. ^Crandall & Pomerance, ex 2.38, pp 106–108 discuss the similarities and differences. For example, tossingn coins, it is possible (though unlikely) to getn/2 heads followed by that many tails. V-P inequality rules that out for residues.
  24. ^Davenport 2000, pp. 135–137, (proof of P–V, (in fact big-O can be replaced by 2); journal references for Paley, Montgomery, and Schur)
  25. ^Planet Math: Proof of Pólya–Vinogradov Inequality inexternal links. The proof is a page long and only requires elementary facts about Gaussian sums
  26. ^Pomerance & Crandall, ex 2.38 pp.106–108. result from T. Cochrane, "On a trigonometric inequality of Vinogradov",J. Number Theory, 27:9–16, 1987
  27. ^abFriedlander, John B.;Iwaniec, Henryk (2010).Opera De Cribro.American Mathematical Society. p. 156.ISBN 978-0-8218-4970-5.Zbl 1226.11099.
  28. ^Montgomery, Hugh L. (1994).Ten Lectures on the Interface Between Analytic Number Theory and Harmonic Analysis.American Mathematical Society. p. 176.ISBN 0-8218-0737-4.Zbl 0814.11001.
  29. ^Bateman, Paul T.; Diamond, Harold G. (2004).Analytic Number Theory. World Scientific. p. 250.ISBN 981-256-080-7.Zbl 1074.11001.
  30. ^Bach & Shallit 1996, p. 104 ff; it requires O(log2m) steps wherem is the number of primes dividingn.
  31. ^Bach & Shallit 1996, p. 113; computing(an){\displaystyle \left({\frac {a}{n}}\right)} requires O(loga logn) steps
  32. ^Lemmermeyer, p. 29
  33. ^Bach & Shallit 1996, p. 156 ff; the algorithm requires O(log4n) steps.
  34. ^Bach & Shallit 1996, p. 156 ff; the algorithm requires O(log3n) steps and is also nondeterministic.
  35. ^Crandall & Pomerance, ex. 6.5 & 6.6, p.273
  36. ^Manders & Adleman 1978
  37. ^Burton, David (2007).Elementary Number Theory. New York: McGraw HIll. p. 195.
  38. ^Stangl, Walter D. (October 1996),"Counting Squares in ℤn"(PDF),Mathematics Magazine,69 (4):285–289,doi:10.2307/2690536,JSTOR 2690536
  39. ^Walker, R."The design and application of modular acoustic diffusing elements"(PDF). BBC Research Department. Retrieved25 October 2016.
  40. ^Bach & Shallit 1996, p. 113
  41. ^Bach & Shallit 1996, pp. 109–110; Euler's criterion requires O(log3n) steps
  42. ^Gauss, DA, arts 329–334

References

TheDisquisitiones Arithmeticae has been translated from Gauss'sCiceronian Latin intoEnglish andGerman. The German edition includes all of his papers on number theory: all the proofs of quadratic reciprocity, the determination of the sign of theGauss sum, the investigations intobiquadratic reciprocity, and unpublished notes.

External links

Fields
Key concepts
Advanced concepts
Bydegree
By properties
Tools and algorithms
Euclidean
geometry
Non-Euclidean
geometry
Other
Lists
Areas
Basic concepts
Algebraic structures
Linear and
multilinear algebra
Algebraic constructions
Topic lists
Glossaries
Retrieved from "https://en.wikipedia.org/w/index.php?title=Quadratic_residue&oldid=1270502772"
Categories:
Hidden categories:

[8]ページ先頭

©2009-2025 Movatter.jp