primitive roots, orders & quadratic residues

8
Primitive Roots,Order,Quadratic Residue Mathmdmb March 30, 2011 1 About This Note and Notations In this note,I am going to discuss some facts related to order,primitive root and quadratic residue along with Legendre symbol and Jacobi symbol.We shall first see some basic ideas,and then work on them a bit.All notations I have used are usual,but I have introduced a new notation(probably),as described later(for denoting primitive roots).First let’s see some definitions we need.Also if the modulo is not mentioned anywhere,there it is to be considered that the modulo remains same, otherwise the modulo is stated. Before starting the note,I must remember some of my AoPS friends-amparvardi(Amir Hossein Parvardi),al-mahed(Al-Mahed) and Moonmathpi496(Tarik Adnan Moon) for their and directions to let me know how to create a pdf and comments for improving its structure.When I completed the task os source code,I found the output pdf incomplete,but I just got stuck.I didn’t understand why it happened.Later fedja informed me about my typo mistake in putting curly braces.So,I also remember and thank him for letting me know where my mis- take was and edit it to finish the pdf. Here goes some notations I used. ?a|b a divides b.Alternatively b leaves remainder 0 upon division by a. ?a 6 |b a does not divide b. ?a b (mod n) a and b gives the same remainder upon division by n. (m) Euler’s toteint function of m. ? gcd(a, b) the greatest common divisor of a and b. ? lcm(a, b) the least common multiple or the smallest positive integer divisible by a and b. ?p prime. ? pr m = g g is a primitive root of m. ?h 6= pr m h is never a primitive root of m. ? ord m (a)= x x is the order of a modulo m. ? qr quadratic residue. ? qnr quadratic non-residue. ?U m = {r 1 ,r 2 , ..., r ϕ(m)} the set of units modulo m,or r 1 ,r 2 , ..., r ϕ(m) are numbers less than m and co-prime to m. ?P Um the product of the elements of U m . 1

Upload: stevtan01

Post on 26-Apr-2017

220 views

Category:

Documents


3 download

TRANSCRIPT

Page 1: Primitive Roots, Orders & Quadratic Residues

Primitive Roots,Order,Quadratic Residue

Mathmdmb

March 30, 2011

1 About This Note and Notations

In this note,I am going to discuss some facts related to order,primitive root andquadratic residue along with Legendre symbol and Jacobi symbol.We shall firstsee some basic ideas,and then work on them a bit.All notations I have usedare usual,but I have introduced a new notation(probably),as described later(fordenoting primitive roots).First let’s see some definitions we need.Also if themodulo is not mentioned anywhere,there it is to be considered that the moduloremains same, otherwise the modulo is stated.Before starting the note,I must remember some of my AoPS friends-amparvardi(AmirHossein Parvardi),al-mahed(Al-Mahed) and Moonmathpi496(Tarik Adnan Moon)for their and directions to let me know how to create a pdf and commentsfor improving its structure.When I completed the task os source code,I foundthe output pdf incomplete,but I just got stuck.I didn’t understand why ithappened.Later fedja informed me about my typo mistake in putting curlybraces.So,I also remember and thank him for letting me know where my mis-take was and edit it to finish the pdf.Here goes some notations I used.? a|b→ a divides b.Alternatively b leaves remainder 0 upon division by a.? a 6 |b→ a does not divide b.? a ≡ b (mod n)→ a and b gives the same remainder upon division by n.? ϕ(m)→ Euler’s toteint function of m.? gcd(a, b)→the greatest common divisor of a and b.? lcm(a, b)→the least common multiple or the smallest positive integer divisibleby a and b.? p→prime.? prm = g → g is a primitive root of m.? h 6= prm → h is never a primitive root of m.? ordm(a) = x→ x is the order of a modulo m.? qr → quadratic residue.? qnr →quadratic non-residue.? Um = {r1, r2, ..., rϕ(m)} → the set of units modulo m,or r1, r2, ..., rϕ(m) arenumbers less than m and co-prime to m.? PUm →the product of the elements of Um.

1

Page 2: Primitive Roots, Orders & Quadratic Residues

2 Definitions

Euler’s Toteint Function:Euler’s Toteint Function ϕ(m) is the number of numbers less than or equalto m and co-prime to m.That is,ϕ(m) is the number of elements x in the set{1, 2, ....,m} for which gcd(m,x) = 1.m = 6,in the set {1, 2, 3, 4, 5, 6} there are two elements co-prime to m,namely1, 5.It is obvious to see that for m = p a prime,ϕ(p) = p−1 since every element lessthan p is co-prime to p.If m > 1,this set does not include the element m becausethen gcd(m,m) > 1.Also for m > 2, ϕ(m) is even.This can be shown by Eu-clidean Algorithm.If gcd(m, a) = 1 then gcd(m,m−a) = 1 too,so the numberof elements co-prime to m must be even.We shall use few well-known facts aboutϕ(m), ϕ(m) is multiplicative,that is, if gcd(m,n) = 1, ϕ(mn) = ϕ(m)ϕ(n) ,ϕ(pa) = pa−1(p − 1) where p is a prime.And if gcd(a,m) = 1 then aϕ(m) ≡ 1(mod m).Definition Of Order:If x is the smallest positive integer such that ax ≡ 1 (mod m) then x is calledthe order of a modulo m and it is denoted by ordm(a) = x.Example. ord8(3) = 2.Definition Of Primitive Root:If g is a positive integer such that ordm(g) = ϕ(m) then g is called a primitiveroot modulo m.Let’s agree to denote it as prm = gNote.This does not mean that there exists a unique pr of m.(Well,then howmany are there?)Definition Of Quadratic Residue:If x2 ≡ a (mod m) for some x,then a is called a quadratic residue of m andwe shortly say a is a qr of m,otherwise a is a quadratic non-residue of mand say it a is a qnr of m shortly.Example. 22 ≡ −1 (mod 5),so −1 is a qr of 5.Definition Of Legendre Symbol:The Legendre symbol for a positive integer a and a prime pis denoted by (ap )and defined as:? (ap ) = 0 if p|a? (ap ) = 1 if a is a qr of p

? (ap ) = −1 if a is a qnr of pProperties Of Legendre Symbol:P1 : a ≡ b =⇒ ( an ) = ( bn )

P2 : (ap ) ≡ ap−12 (mod p)

If p|a,it is trivial.Again it is trivial for p = 2 too.So, consider p 6 |a, p > 2odd.From Fermat’s little theorem,we know that if p 6 |a, ap−1 ≡ 1 (mod p).Takesquare root on both sides(we can do this as we described before).

Now if a ≡ x2 for some x then ap−12 ≡ (x2)

p−12 ≡ xp−1 ≡ 1 (mod p)

Thus the property holds.This property is called Euler’s Criterion.

A special case:(−1p ) = (−1)p−12 .So (−1p ) = −1 if p ≡ 3 (mod 4), 1 otherwise.

2

Page 3: Primitive Roots, Orders & Quadratic Residues

P3.For a prime p,there is exactly p−12 qr’s namely 12, ....(p−12 )2

P4.Legendre symbol is multiplicative,that is (abp ) = (ap )( bp ) for all integers a, band p > 2.

P5.(2p ) = (−1)

p2−18

(We are not proving this here.You may read from google or wikipedia for detailson the facts I have used here.) Thus ( 2

p ) = 1 if p ≡ ±1 (mod 8),−1 if p ≡ ±3

(mod 8)Definition Of Jacobi Symbol:Jacobi Symbol is the generalization of Legendre symbol,it is defined for all oddn > 1.Thus it becomes Legendre symbol when m is a prime.? ( an ) = 0 if gcd(a, n) 6= 1? ( an ) = ±1 if gcd(a, n) = 1.

? (abn ) = ( an )( bn ),so (a2

n ) = 1 or 0.? ( a

mn ) = ( am )( an ),so ( an ) = 1 or 0.? (−1n ) = 1 if n ≡ 1 (mod 4),−1 otherwise.Definition Of Perfect Power In Congruence:

An integer a is called a pefect k − th power of m iff aφ(m)

gcd(φ(m),k) ≡ 1 (mod m).

3

Page 4: Primitive Roots, Orders & Quadratic Residues

3 Lemmas and Theorems

Lemma 1::Let prm = g,then g

ϕ(m)2 ≡ −1 (mod m)

Proof:We may let m > 2.Now gϕ(m) ≡ 1 (mod m).So either g

ϕ(m)2 ≡ −1 or 1

(mod m).Otherwise m would divide their difference 2,but m > 2 as we said.Also

ϕ(m) ≥ 2 is even.Then in the second case,ϕ(m)2 would be a smaller num-

ber than ϕ(m) for which gφ(m)

2 ≡ 1 (mod m),contradicting the minimality

of φ(m).Hence,from the definition,gϕ(m)

2 ≡ −1 (mod m)Corollary:

If gϕ(m)

2 ≡ 1 (mod m), g 6= prm or m does not have a primitive root.Generalization Of The Corollary:If d > 1 is a divisor of ϕ(m),such that

aϕ(m)d ≡ 1 (mod m),then m does not have a primitive root.

Lemma 2::For every ri,there exists a unique rj such that rirj ≡ a (mod m) where a is aqnr of m and gcd(a,m) = 1.Proof:Of-course i 6= j,otherwise r2i ≡ a (mod m) which would imply that a is a qrof m.Also if rirj = mq + a, 0 < a < m.Now ri, rj both does not share any commonfactor other than 1 with m,so does rirj too.Then we getgcd(rirj ,m) = 1 =⇒ gcd(m,mq + a) = 1 =⇒ gcd(m, a) = 1.This means that the remainder of rirj when divided by m lies in the set Um,thatis a is co-prime to m and a qnr of m.Now let’s prove that this rj is unique.If ri ≡ rj (mod m), 1 ≤ i, j ≤ ϕ(m),thenm|ri−rj but |ri−rj | < m,contradiction.Corollary:For 1 ≤ k ≤ ϕ(m),{rkr1, rkr2, ..., rkrϕ(m)} is a reduced system of m.Indeed.If rkri ≡ rkrj (mod m),we have ri ≡ rj (mod m).Since gcd(m, rk) = 1 wecan divide the congruence relation by rk.But this yields a contradiction.So the claim is true.Lemma 3::If prm = g,then {g, g2, ..., gϕ(m)} is a reduced system of mProof:If gi ≡ gj then gj−i ≡ 1,since gcd(m, g) = 1.But |j − i| < ϕ(m).Contradiction!Corollary:{1, g, g2, ..., gϕ(m)−1} is a reduced system of m.Lemma 4::If ordm(g) = d and gn ≡ 1, d|nProof:Let n = dq + r, 0 ≤ r < d.we get gn ≡ gdq+r ≡ (gd)q.gr ≡ gr ≡ 1 but gd ≡ 1with d smallest where r < d.So we must have r = 0.Corollary 1::If ordm(a) = d, d|ϕ(m).

4

Page 5: Primitive Roots, Orders & Quadratic Residues

Corollary 2::{a, a2, ..., ad} is a reduced system of m.That is,we can use g as a generator ofm to produce all the numbers r1, r2, ....., rϕ(m)

which are co-prime to m.Now let’s see a theorem.we shall proceed on this theorem later.Theorem :The product of the elements of Um gives remainder −1 upon division by m ifm has a primitive root.Proof :Let prm = g,then g is a generator of m with order ϕ(m).Hence,gi is congruentto exactly one of ri.Then

g.g2...gϕ(m) ≡ r1r2...rϕ(m)

=⇒ r1...rϕ(m) ≡ gϕ(m)(ϕ(m)+1)

2

=⇒ r1...rϕ(m) ≡ {gϕ(m)

2 }ϕ(m)+1

Now since ϕ(m) even,ϕ(m) + 1 is odd.So using lemma 1,we get

r1...rϕ(m) ≡ (−1)ϕ(m)

2 +1 ≡ −1 (mod m)Thus the theorem is proved.The converse is also true.Theorem :PUm ≡ ±1 (mod m).Proof :According to lemma 3,there is a unique rj for every ri in Um such that rirj ≡ a,ais a co-prime qnr of m.Also for distinct i’s we shall get distinct j’s.Therefore,wemay pair up all ϕ(m) elements of Um such that:

r1r2...rϕ(m) ≡ a.a...a(ϕ(m)2 ) times.Then PUm ≡ ±1 (mod m).

Now from lemma 1,if there exists a prm = g,then PUm ≡ −1,else PUm ≡ 1.Therefore,this is an iff theorem.Corollary:We know from Euclidean Algorithm that gcd(a,m) = gcd(a,m−a).Also gcd(m, 1) =gcd(m,m− 1) = 1For this reason we can rearrange Um in increasing order.Then obviouslyr1 = 1, rϕ(m) = m− 1, rφ(m)−1 = m− r2, ..., rϕ(m)

2

+ 1 = m− rϕ(m)2

.

We note that rϕ(m) ≡ −r1, rϕ(m)−1 ≡ −r2, ....And PUm becomes r1r2...rϕ(m)rϕ(m)

2 +1...rϕ(m) ≡ a

ϕ(m)2 from which it follows

thatr1rϕ(m)r2.rϕ(m)−1....rϕ(m)

2

rϕ(m)2 +1

≡ (−1)r21.(−1)r22....(−1)r2ϕ(m)2

≡ aϕ(m)

2

We shall make further progress on this,but before that we need some otherlemmas.Lemma 5::If k > 2,m = 2k has no primitive root.Proof:Let gcd(a, 2k) = 1,then a odd.We know that a2 ≡ 1 (mod 23),or 23|a2 − 1So,using the identity a2 − b2 = (a+ b)(a− b) repeatedly,

5

Page 6: Primitive Roots, Orders & Quadratic Residues

a2k−2 − 1 = (a2

k−3

+ 1)(a2k−3 − 1) = (a2

k−3

+ 1)(a2k−4

+ 1)....(a2 − 1)

We infer that a2k−2 ≡ 1 (mod m) =⇒ a

ϕ(2k)2 ≡ 1 (mod 2k) which shows that

m = 2k has no primitive roots.(Note that 2, 4 have primitive roots namely 1, 3because in the identity above we needed k − 2 > 0.)Lemma 6:m = 2kl, l > 1 odd has no primitive roots.Proof:Let gcd(a,m) = 1.Then from euler’s function,a2

k−1 ≡ 1 (mod 2k), aϕ(l) ≡ 1(mod l).

Note that from the identity a−1|an−1,we get that a2k−1−1, aφ(l)−1|alcm(2k−1,ϕ(l))−

1We conclude that alcm(2k−1,φ(l)) ≡ 1 (mod 2kl)Now since ϕ(l) even,so gcd(2k−1, ϕ(l)) = 2r for some natural n.Then applying

the fact ab = gcd(a, b).lcm(a, b) to the congruence above,we get that a2k−1ϕ(l)

2r ≡1 =⇒ a

ϕ(m)2 ≡ 1 (mod m),(after raising to power r on both sides).

From the corollary of lemma 1,we can say that m does not possess a primitiveroot.And as a corollary,we get the following theorem:Theorem:The only values of m having primitive roots are m = 2, 4, pk, 2pk where p is anodd prime and k is a positive integer.Corollary 1:If m = m1m2, gcd(m1,m2) = 1 with m1,m2 > 2 then m does not have anyprimitive root.Corollary 2:If m has two different prime factors than m has primitive root only for m = 2pk

Now let’s get back to the corollary of the converse theorem we proved whichstated that(−1)

ϕ(m)2 r21r

22.....r

2ϕ(m)

2

≡ aϕ(m)

2 (mod m)

.We consider m > 2 has a primitive root,m = pk or m = 2pk

In both cases,if p ≡ 1 (mod 4) then ϕ(m) = pk−1(p− 1) which is divisible by4 implying that r21r

22...r

2ϕ(m)

2

≡ −1

If p ≡ 3 (mod 4), then r21r22...r

2ϕ(m)

2

≡ 1 (mod m)

So, using Jacobi symbol in the previous result we find that if m = pk, p odd,thenr21r

22...r

2ϕ(m)

2

≡ −1 (mod m) when (−1m ) = 1.Else r21r22...r

2ϕ(m)

2

≡ 1.

If m ≡ 1 (mod 4),then r21r22...r

2ϕ(m)

2

≡ −1 =⇒ i ≡ r1r2...rϕ(m)2

(mod m)

where i2 ≡ −1 (mod m).Also,r21r

22...r

2ϕ(m)

2

≡ −1 ≡ r1r2...rϕ(m) =⇒ r1r2...rϕ(m)2

≡ rϕ(m)2 +1

.....rφ(m) ≡ i

(mod m)In other words if r1, r2, ...., rpk−1(p−1) are positive integers such that no ri have

a prime factor p,then pk|r pk−1(p−1)2 +1

....rpk−1(p−1) − r1r2..r pk−1(p−1)2

Special Case:When k = 1,we get ri = i for 1 ≤ i ≤ ϕ(p) = p − 1 and then

6

Page 7: Primitive Roots, Orders & Quadratic Residues

p|(p− 1)....p+12 − 1.2....p−12 .

So let p = 2k + 1,it becomes p| (p−1)!k! − k!.You can work on it more yourself and develop these properties further.

4 Some Congruences On Primes

In this section,we shall basically see whether a particular number can be theprimitive root or not of a prime.Also is an integer is a perfect power modulop.Let’s consider 1 < a < p− 1 in all cases.The modulo p will be taken through-out the whole section if not stated,otherwise the modulo is stated everywhere.Claim 1:If p ≡ 1 (mod 4),then aa ≡ 1 (mod p) has at least one solution.Example.p = 13 = 4.3 + 1, 33 ≡ 1 (mod 13)Proof :We will show that a = p−1

4 works here.So let,n = p−14 .

Then 4n = p− 1 ≡ −1 (mod p),=⇒ n ≡ −14 ≡ ( i2 )2 (mod p) where i2 ≡ −1(mod p) and the existence of such i is guaranteed by P2 of Legendre symbol inthe section Definitions.Consider two cases:Case 1:p ≡ 5 (mod 8),then from Legendre symbol,we get ( 2

p ) = −1, 2p−12 ≡

−1.Also ip−12 ≡ (−1)

p−14 ≡ −1 (mod 8).These two imply that aa ≡ ( i2 )

p−12 ≡

−1−1 ≡ 1.

Case 2:p ≡ 1 (mod 8),then similarly we get 2p−12 ≡ 1.Also i

p−12 ≡ (−1)

p−14 ≡

1.Thus it is true for both cases.Corollary 1:p−14 6= prp if p ≡ 1 (mod p).

This follows directly from the generalization of the corollary of lemma 1.Corollary 2:a = p−1

4 is a perfect 4− th power of p. It is straight forward from the definitionsince ϕ(p) = p− 1.Claim 2:Take p ≡ 3 (mod 8).Then aa ≡ 1 has at least one solution.Example.p = 11, a = 5, 55 ≡ 1 (mod 11)Proof :Several examples convince us that we should take a = p−1

2 this time.Let’s try.

Note that 2 is a qnr of p yielding ( 2p ) = −1, 2

p−12 .Moreover,(p − 1)

p−12 ≡

(−1)p−12 ≡ −1 yielding aa ≡ −1−1 ≡ 1. Hence,the conclusion follows.

Corollary 1:a = p−1

2 is a perfect square of p ≡ 3 (mod 8).Corollary 2:a = p−1

2 6= prp for p ≡ 3 (mod 8).

7

Page 8: Primitive Roots, Orders & Quadratic Residues

Claim 3:Let n = p+1

2 , be positive integer where p ≡ −1 (mod 8).Then nn−1 ≡ 1.Example.p = 7, n = 4, 43 ≡ 1 (mod 7).Proof :p ≡ −1 (mod 8) =⇒ ( 2

p ) = 1 =⇒ 2p−12 ≡ 1 ≡ 2p−1 =⇒ 1

2p−12

≡ 1.

The rest is to just see that n = p+12 ≡

12 and nn−1 ≡ ( 1

2 )p−12 ≡ 1.

Corollary 1:a = p+1

2 is a perfect square of p ≡ −1 (mod 8).Corollary 2:a = p+1

2 6= prp for p ≡ −1 (mod 8).Claim 4:Let p+1

4 = n be a positive integer.We want to show that np−34 ≡ ±2.

Proof :4n = p+ 1 ≡ 1 (mod 8) =⇒ n ≡ 1

4 ≡12 )2.

Therefore,we may say that, 1√n≡ 2.

Since p−34 = p−1

2 −12 ,using this we get n

p−34 ≡ n

p−12 . 1√

n≡ ( 1

2 )p−12 .2 ≡ ±2,as

desired.Corollary:

? 1.If ( 2p ) = 1 or p ≡ −1 (mod 8),then n

p−34 ≡ 2.

? 1.If ( 2p ) = −1 or p ≡ 3 (mod 8),then n

p−34 ≡ −2.

I am ending the section with a question.Question.Does there always exist an a such that aa ≡ 1 for all p?Well,we have proved this existence for all p ≡ 1 (mod 4), p ≡ 3 (mod 8)above.Then we just need to consider the case when p ≡ −1 (mod 8).

8