Quadratic Residues-Legendre and Jacobi Symbols

Quadratic Congruence
 
There is a general question whether an integer a has a square root (modn) and if so, how many are there and how one can find them.

We know that the solution of the quadratic equation can be found by 
x=b±b24ac2a

If we want to apply this to the case where a,b,cZn, then 2a to be unit in (modn), so that we can divide by 2a.

We can write the equation in the form

(2ax+b)2=b24ac

If we can find all the square roots s of b24ac in Zn, we can then find all the solutions xZn of the quadratic equation of the form 2ax+b=s, or equivalently x=(sb)/2a.

If we look at the square roots at Z15, then  1 and 4 have four square roots each(±1,±4 and ±2,±7 respectively, while the other units have none.

Example:
Find all the solutions of x23x+20(mod15)

given a=1,b=3 and c=2, we have:
b24ac=(3)24(1)(2)=98=1

So, b24ac=1.

Now, we need to find the square roots of 1 modulo 15. The solutions to x21(mod15) are x±1(mod15).

Using the quadratic formula:

For x1:

x1=((3)+1)/2=(3+1)/2=2



For x2:

x2=((3)1)/2=(31)/2=1



So, the solutions modulo 15 are x1(mod15)and x2(mod15)

Example:Solve the quadratic congruence 3x24x+70(mod13) 

Lets apply (2ax+b)2=b24ac

(6x4)210(mod13)

let y=6x4.then y210(mod13). This congruence has exactly two solutions y6,7(mod13)

Therefore the solutions of the congruence are given by those of linear congruences 6x46(mod13) and 6x47(mod13) namely x6,4(mod13)

Note that the quadratic congruence in this example has exactly two solutions.But the next example shows that not every quadratic congruence has a solution.

Example: Solve 3x2+7x+50(mod13).This congruence yields (6x+7)22(mod13).But square of none of the least residues modulo 13 yields 2.So this is not solvable.

Now the question arise when the congruence x2a(modp) is solvable? when solvable how many solutions does it have.

if p|a then x20(modp), so x0(modp) is the only solution. Now assume pa. The congruence has exactly two solutions.

lemma: Let p be an odd prime and a an integer such that pa. Then the congruence x2a(modp) has either no solutions or exactly two incongruent solutions.

Quadratic Residue and  The Group of Quadratic Residue

An element aUn is a quadratic residue (modn) if a=s2 for some sUn.The set of such quadratic residues is denoted by Qn.For small n one can determine Qn by squaring all elements sUn

Example:

Consider the positive integers less than 10. We'll calculate their squares modulo 10 to identify quadratic residues.
02=0(mod10)-0 is a quadratic residue modulo 10.
121(mod10)- 1 is a quadratic residue 
224(mod10) - 4 is a quadratic residue.
329(mod10) - 9 is a quadratic residue.
426(mod10) - 6 is a quadratic residue.
525(mod10) - 5 is a quadratic residue.
626(mod10) - 6 is a quadratic residue.
729(mod10) - 9 is a quadratic residue.
824(mod10)- 4 is a quadratic residue.
921(mod10) - 1 is a quadratic residue.

So, the quadratic residues modulo 10 are 1, 4, 5, 6, and 9.If we consider units Q10={1,9}U10

Q7={1,2,4}U7
Q8={1}U8

Python Code
list all quadratic residues
from sympy.ntheory import quadratic_residues
print(quadratic_residues(10))
[0,1,4,5,6,9]
check whether an element is a quadratic residue
from sympy.ntheory import is_quad_residue
print(is_quad_residue(4,10))
True
print(is_quad_residue(7,10))
False

Example:Find the quadratic residue and  nonresidues of p=13
121122(mod13)224112(mod13)
329102(mod13)42392(mod13)
521282(mod13)621072(mod13)
Accordingly 13 has exactly six quadratic residues namely 1,3,4,9,10 and 12, and it has six quadratic non residues also, namely 2,5,6,7,8 and 11.
This example provides us with two interesting bonuses
  • The prime 13 has the same number of quadratic residues and non residues(6 each)
  • They form the partitioning of the set of positive residues of 13.
Theorem: every odd prime p has exactly (p1)/2 quadratic residues and (p1)/2 quadratic non residues.

We can determine how many square roots an element aQn can have


Note : Qn is a subgroup of Un
 
Lemma: Let n>2 and suppose that there is a primitive root g(modn), then Qn is a cyclic group of order ϕ(n)/2, generated by g2 consisting of the even powers of g.
Example: If n=7 then we can take g=3 as primitive root. The powers of g in U7 are g=3,g2=2,g3=6,g4=4,g5=5 and g6=1; of these the quadratic residues a=1,2 and 4 corresponds to the even powers of g. Thus Q7 is the cyclic group of order 3 generated by g2=2

Legendre Symbol ( Adrein-marie Legendre 1978)
 
The Legendre symbol is a mathematical concept used in number theory to determine whether a given integer is a quadratic residue modulo a prime number. It is denoted as (ap), where a is an integer and p is an odd prime number. 
 
The Legendre symbol is defined as follows:
This shows that x2a(modp) is solvable if and only if (ap=1)

Python Code
from sympy.ntheory import legendre_symbol
ls=[legendre_symbol(i, 7) for i in range(7)]
print(ls)
[0, 1, 1, -1, 1, -1, -1]
 
The following theorem shows three fundamental properties of the symbol
Theorem: Let p be an odd prime and a and b be any integers with pab. Then
  • if ab(modp) then (ap)=(bp)
  • (abp)=(ap)(bp)
  • (a2p)=1
 
Corollary:If p is an odd prime and g is a primitive root (modp) then
(gip)=(1)i

\mlegendre{x}{y}

Reference: https://www.physicsforums.com/threads/latex-frustration-defining-commands-with-arguments.277730/
(xy)

Reference: https://www.physicsforums.com/threads/latex-frustration-defining-commands-with-arguments.277730/
Note: when i is even gi generates a quadratic residue.
 
Corollary: If p be an odd prime, q a prime such that pq, and i is a positive integer. Then (qip)=(qp)i
Example:Using the fact that (517)=1, compute (12517)
 
(12517)=(5317)
=(517)3
=(1)3=1
 
Multiplicativity
if p is an odd prime, then

(abp)=(ap)(bp)
for all integers a and b.
 
Example:
The set Q13={1,3,4,9,10,12}.So (613)=1. This can be verified (213)(313)=1×1=1

(a1,,akp)=(a1p)(akp)

Example: Using the fact that (223)=1 and (523)=1 , compute (500023)

Notice that 5000=23.54. So

(500023)=(223)3(523)4

 (500023)=(1)3.(1)4=1

So 5000 is a quadratic residue in (mod23)

Theorem:Euler's Criterion

Let p be an odd prime. then a positive integer a with pa is a quadratic residue of p if and only if a(p1)/21(modp)

if p is an odd prime, then for all integers a we have

a(p1)/2=(ap)


Example:

Consider a=5 and p=13. We want to determine whether 5 is a quadratic residue modulo 13, that is, we want to find (513)
According to Euler's criteria
56=52.52.52=1.1.1=1(mod13). So 5 is not a quadratic residue in Z13

Example:
Determine if 10 and 7 are quadratic residues of 13.
 
notice that 10(131)/2=106(3)61(mod13). So by Euler's criterion 10 is a quadratic residue of 13.

7(131)/276(73)25621(mod13). Since 761(mod13), by Euler's criterion 7 is a quadratic non residue of 13.

Note:If p is an odd prime. Then a positive integer a, where pa is a quadratic nonresidue if and only if a(p1)/21(modp)

corollary: If p is an odd prime. Then 1Qp if and only if p1(mod4)
(1p)1ifp1(mod4)
(1p)1ifp1(mod4)
 
Proof: if we take a=1 in Euler's criteria
(1p)(1)(p1)/2(modp)
 
So 1Qp only if  (p1)/2 is even that is p1(mod4)
 
Example:
We have 1=22(mod5) and 1=52(mod13) .But -1 is not a quadratic residue in Z7 or Z3.
Example:
Let p=17 , then 142. So (117)=1.This shows that (a17)=(a17)  for all aU17. That is aQ17 if and only if aQ17. For instance 13Q17 since 1322Q17
 
This can be used to evaluate the Legendre Equations
Example: evaluate (441) 
 
(441)=(441)(141)
(441)=1.1=1
So -4 is a quadratic residue in (mod41) 

Note:There are infinitely many primes of the form 4n+1

Gauss' Lemma
Let p be an odd prime.We can partition the set Up into two sets
P={1,2,,(p1)/2}UpandN={1,2,,(p1)/2}Up
 
represented  as shown by positive and  negative integers.For each aUp, we define 
aP={a,2a,,a(p1)/2}Up

Gauss Lemma says that
If p is an odd prime and aUp, then (ap)=(1)μ, where μ=|aPN|

Example:
Let p=19.So P={1,2,3,4,5,6,7,8,9}.If we multiply each element of P by 11 and represent it by an element of PN, we get
aP=11P={8,3,5,6,2,9,1,7,4}


This contains four elements of N, (terms with minus sign).So μ=4, which is even.Thus 119=1, So 11Q19. In fact 1172(mod19)

Example:
Evaluate (1013) using Gauss lemma 
Here P={1,2,3,4,5,6} and N={1,2,3,4,5,6} 
10P={3,6,4,1,2,5}
here μ=4
So (1013)=(1)4=1
 
Example:
Evaluate (213) using Gauss lemma 
Here P={1,2,3,4,5,6} and N={1,2,3,4,5,6} 
2P={2,4,6,5,3,1}
here μ=3
So (213)=(1)3=1

Corollary:
If p is an odd prime. Then
(2p)=(1)(p21)/8
thus 2Qp if and only if p±1(mod8)
 2Qp if and only if p±3(mod8)
 
Example:
2 is a  quadratic residue (modp) for p=7,17,23,31, with square roots ±3,±6,±5,±8,,however, 2 is not a quadratic residue (modp) for p=3,5,11,13,

Example: solve (1331)
 (1331)=(1831)

=(931).(231).(131)
Note:311(mod8) and also 311(mod4)

=1.1.1=1
So 13Q31

Quadratic Reciprocity
To determine whether or not an integer a is a quadratic residue (modp),we need to evaluate (ap).For the prime factorization of a, we can evaluate (qp) for the qs dividing a.The following table shows the evaluation of  (qp) for small values of p and q.

Theorem:
If p and q are distinct odd primes, then

(qp)=(pq)
except when pq3(mod4) , in which case
(qp)=(pq)
 
Note:An equivalent  form of this is the elegant result by Legendre is that
(qp).(pq)=(1)(p1)(q1)/4
 
for all distinct odd primes p and q. This is the generalized Law of Quadratic Reciprocity.

Proof: if p1(mod4) then (p1)/2 is even, so (p1)(q1)/4 is even. Therefore by the law of quadratic reciprocity (p/q)(q/p)=1.But (p/q)±1=(q/p), so (q/p)=(p/q).
On the other hand assume that pq3(mod4).Then (p1)/2,(q1)/2 and hence (p1)(q1)/4 are odd.Therefore , again by the law of quadratic reciprocity (p/q).(q/p)=1.Thus (p/q)=(q/p)
Example:Since 171(mod4),(1729)=(2917) and since 233(mod4) and 473(mod4),(2347)=(4723)

Example:
Compute (15243)
 
 (15243)=(2343)
Note that 23 and 43 are primes of form 4n+3 so
(2343)=(4323)
=(2023)
=(423).(523)
=1.(523) 
=1.(235) 
=1.(35)  
=1.1=1
Consequently the congruence   x2152(mod53) is solvable.

Example:
Compute (37977297)
(37977297)=(72973797)
=(35003797)
=(22.53.73797)
 
Note  (23797)2=1
(53797)3=(25)=(1)3=1
(73797)=(37)=1
therefore
 =(22.53.73797)
=1.1.1=1
thus the congruence x23797(mod7297) is solvable

Jacobi Symbol
 
Jacobi symbol is the generalization of the Legendre Symbol, which was introduced in 1846 by the German Mathematician Karl G J Jacobi.In the Jacobi symbol (am), the modulus m need not be prime, but must be odd and relatively prime to a.

Let m be an odd positive integer with the canonical decomposition m=ki=1Peii and a any integer with gcd(a,m)=1. Then the Jacobi symbol (am) is defined by

(am)=(aki=1Peii)=ki=1(aPeii)
 
where (aPi) denotes the familiar Legendre symbol.Although we use the same notation, bear in mind that the symbol (am) is the Legendre symbol if and only if m is prime.

Thus if x2a(modm) is solvable , then the Jacobi symbol (ap)=1.How ever this does not imply that x2a(modm) is solvable when (am)=1.For example (233)=(23.11)=(23)(211)=1.1=1.but x22(mod33) has no solutions.

Example: evaluate the jacobi Symbol (55273)
Note 273=3.7.13, So by the definition of the Jacobi symbol
(55273)=(553).(557).(5513)
=(13)(17).(313)
=1.1.(133)
=(13)=1

Python Code
from sympy.ntheory import jacobi_symbol
from sympy import S
print(S(273).factors())
print(jacobi_symbol(55,273))
{3: 1, 7: 1, 13: 1}
-1

Theorem:
let m be an odd positive integer, and a and b be any integers with gcd(a,m,)=1=gcd(b,m). then
  • if ab(modm),, then (am)=(bm)
  • (abm)=(am)(bm)
  • (a2m)=1

Theorem:

Let m be an odd positive integer.Then
 
  • (1m)=(1)(m1)/2
  • (2m)=(1)(m21)/8
 Theorem:
The generalized law of Quadratic Reciprocity 
let m and n be relatively prime odd positive integers. Then
 (mn)(nm)=(1)(m1)/2.(n1)/2

Example:Compute the jacobi Symbol (221/399)
(221/399)=(1)(2211)/2.(3991)/2(399/221)
=(178/221)=(2/221)(89/221)
 
(2/221)=(1)(22121)/8=1

(89/221)=(1)(891)/2.(2211)/2(221/89)
=(221/89)=(43/89)
=(1)(431)/2.(891)/2(89/43)
=(89/43)=(3/43)
=(1)(431)/2.(31)/2(43/3)
=(43/3)=(1/3)
=1
 
So (221/399)=(1)(1)=1

Example:Solve the congruence x215(mod187)
First notice that 187=11.17 and (15/11)=(15/17)=1. So the congruences x215(mod11) and x215(mod17) are solvable.Thus x215(mod187) is also solvable.

You may note that the two incongruent solutions of x215(mod11) are x±2(mod11) and those of x215(mod17) are x±7(mod17). Therefore by CRT(Chinese Remainder Theorem), the given congruence has four incongruent solutions.So the solutions are x±24,±75(mod187) ie; x=24,75,112,163(mod187).
\mlegendre{x}{y}

Reference: https://www.physicsforums.com/threads/latex-frustration-defining-commands-with-arguments.277730/

Comments

Popular posts from this blog

Number Theory CST 292 KTU IV Semester Honors Course Notes Dr Binu V P 9847390760

Sum of Squares

Well Ordering Principle