You are on page 1of 8

Primitive Roots,Order,Quadratic Residue

Mathmdmb March 30, 2011

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 rst 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 lets see some denitions 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 didnt 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 mistake was and edit it to nish the pdf. Here goes some notations I used. a|b a divides b.Alternatively b leaves remainder 0 upon division by a. a |b a does not divide b. a b (mod n) a and b gives the same remainder upon division by n. (m) Eulers 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. prm = g g is a primitive root of m. h = 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) are numbers less than m and co-prime to m. PUm the product of the elements of Um .

Denitions

Eulers Toteint Function: Eulers Toteint Function (m) is the number of numbers less than or equal to 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,namely 1, 5. It is obvious to see that for m = p a prime,(p) = p 1 since every element less than p is co-prime to p.If m > 1,this set does not include the element m because then gcd(m, m) > 1.Also for m > 2, (m) is even.This can be shown by Euclidean Algorithm.If gcd(m, a) = 1 then gcd(m, m a) = 1 too,so the number of 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 ) = pa1 (p 1) where p is a prime.And if gcd(a, m) = 1 then a(m) 1 (mod m). Denition Of Order: If x is the smallest positive integer such that ax 1 (mod m) then x is called the order of a modulo m and it is denoted by ordm (a) = x. Example. ord8 (3) = 2. Denition Of Primitive Root: If g is a positive integer such that ordm (g ) = (m) then g is called a primitive root modulo m.Lets agree to denote it as prm = g Note.This does not mean that there exists a unique pr of m.(Well,then how many are there?) Denition Of Quadratic Residue: If x2 a (mod m) for some x,then a is called a quadratic residue of m and we shortly say a is a qr of m,otherwise a is a quadratic non-residue of m and say it a is a qnr of m shortly. Example. 22 1 (mod 5),so 1 is a qr of 5. Denition Of Legendre Symbol: The Legendre symbol for a positive integer a and a prime pis denoted by ( a p) and dened as: (a p ) = 0 if p|a a ( p ) = 1 if a is a qr of p (a p ) = 1 if a is a qnr of p Properties Of Legendre Symbol: a b P1 : a b = ( n ) = (n ) p1 a 2 P2 : ( p ) a (mod p) If p|a,it is trivial.Again it is trivial for p = 2 too.So, consider p |a, p > 2 odd.From Fermats little theorem,we know that if p |a, ap1 1 (mod p).Take square root on both sides(we can do this as we described before). p1 p1 Now if a x2 for some x then a 2 (x2 ) 2 xp1 1 (mod p) Thus the property holds.This property is called Eulers Criterion. p1 1 1 2 .So ( A special case:( p ) = (1) p ) = 1 if p 3 (mod 4), 1 otherwise. 2

1 p 1 2 2 P3 .For a prime p,there is exactly p 2 qr s namely 1 , ....( 2 ) a b P4 .Legendre symbol is multiplicative,that is ( ab p ) = ( p )( p ) for all integers a, b and p > 2. 2 P5 .( p ) = (1) 8 (We are not proving this here.You may read from google or wikipedia for details 2 ) = 1 if p 1 (mod 8),1 if p 3 on the facts I have used here.) Thus ( p (mod 8) Denition Of Jacobi Symbol: Jacobi Symbol is the generalization of Legendre symbol,it is dened for all odd n > 1.Thus it becomes Legendre symbol when m is a prime. a (n ) = 0 if gcd(a, n) = 1 a ( n ) = 1 if gcd(a, n) = 1. a b a2 ( ab n ) = ( n )( n ),so ( n ) = 1 or 0. a a a a ) = 1 or 0. ( mn ) = ( m )( n ),so ( n 1 ( n ) = 1 if n 1 (mod 4),1 otherwise. Denition Of Perfect Power In Congruence:
(m) p2 1

An integer a is called a pefect k th power of m i a gcd((m),k) 1

(mod m).

Lemmas and Theorems

Lemma 1:: (m) Let prm = g,then g 2 1 (mod m) Proof: (m) We may let m > 2.Now g (m) 1 (mod m).So either g 2 1 or 1 (mod m).Otherwise m would divide their dierence 2,but m > 2 as we said.Also m) (m) 2 is even.Then in the second case, (2 would be a smaller number than (m) for which g 2 1 (mod m),contradicting the minimality (m) of (m).Hence,from the denition,g 2 1 (mod m) Corollary: (m) If g 2 1 (mod m), g = prm or m does not have a primitive root. Generalization Of The Corollary:If d > 1 is a divisor of (m),such that (m) a d 1 (mod m),then m does not have a primitive root. Lemma 2:: For every ri ,there exists a unique rj such that ri rj a (mod m) where a is a qnr of m and gcd(a, m) = 1. Proof: 2 Of-course i = j,otherwise ri a (mod m) which would imply that a is a qr of m. Also if ri rj = mq + a, 0 < a < m.Now ri , rj both does not share any common factor other than 1 with m,so does ri rj too.Then we get gcd(ri rj , m) = 1 = gcd(m, mq + a) = 1 = gcd(m, a) = 1. This means that the remainder of ri rj when divided by m lies in the set Um ,that is a is co-prime to m and a qnr of m.Now lets prove that this rj is unique. If ri rj (mod m), 1 i, j (m),then m|ri rj but |ri rj | < m,contradiction. Corollary: For 1 k (m),{rk r1 , rk r2 , ..., rk r(m) } is a reduced system of m. Indeed. If rk ri rk rj (mod m),we have ri rj (mod m).Since gcd(m, rk ) = 1 we can divide the congruence relation by rk .But this yields a contradiction. So the claim is true. Lemma 3:: If prm = g ,then {g, g 2 , ..., g (m) } is a reduced system of m Proof: If g i g j then g j i 1,since gcd(m, g ) = 1.But |j i| < (m).Contradiction! Corollary: {1, g, g 2 , ..., g (m)1 } is a reduced system of m. Lemma 4:: If ordm (g ) = d and g n 1, d|n Proof: Let n = dq + r, 0 r < d.we get g n g dq+r (g d )q .g r g r 1 but g d 1 with d smallest where r < d.So we must have r = 0. Corollary 1:: If ordm (a) = d, d|(m). 4
(m)

Corollary 2:: {a, a2 , ..., ad } is a reduced system of m. That is,we can use g as a generator of m to produce all the numbers r1 , r2 , ....., r(m) which are co-prime to m. Now lets 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 if m has a primitive root. Proof : Let prm = g,then g is a generator of m with order (m).Hence,g i is congruent to exactly one of ri .Then g.g 2 ...g (m) r1 r2 ...r(m) = r1 ...r(m) g
(m)((m)+1) 2 (m)

= r1 ...r(m) {g 2 }(m)+1 Now since (m) even,(m) + 1 is odd.So using lemma 1,we get (m) r1 ...r(m) (1) 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 ri rj a,a is a co-prime qnr of m.Also for distinct is we shall get distinct j s.Therefore,we may pair up all (m) elements of Um such that: m) r1 r2 ...r(m) a.a...a( (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 i theorem. Corollary: We know from Euclidean Algorithm that gcd(a, m) = gcd(a, ma).Also gcd(m, 1) = gcd(m, m 1) = 1 For this reason we can rearrange Um in increasing order.Then obviously r1 = 1, r(m) = m 1, r(m)1 = m r2 , ..., r (m) + 1 = m r (m) . 2 2 We note that r(m) r1 , r(m)1 r2 , .... And PUm becomes r1 r2 ...r(m) r (m) +1 ...r(m) a 2 from which it follows 2 that (m) 2 2 2 r1 r(m) r2 .r(m)1 ....r (m) r (m) +1 (1)r1 .(1)r2 ....(1)r2 (m) a
2 2 2 (m)

We shall make further progress on this,but before that we need some other lemmas. 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 1 So,using the identity a2 b2 = (a + b)(a b) repeatedly,

a2

k2

1 = (a2

k3

+ 1)(a2

k3

1) = (a2

k3

+ 1)(a2

k4

+ 1)....(a2 1)

We infer that a2 1 (mod m) = a 1 (mod 2k ) which shows that k m = 2 has no primitive roots.(Note that 2, 4 have primitive roots namely 1, 3 because in the identity above we needed k 2 > 0.) Lemma 6: m = 2k l, l > 1 odd has no primitive roots. Proof: k1 Let gcd(a, m) = 1.Then from eulers function,a2 1 (mod 2k ), a(l) 1 (mod l). k1 k 1 Note that from the identity a1|an 1,we get that a2 1, a(l) 1|alcm(2 ,(l)) 1 k 1 We conclude that alcm(2 ,(l)) 1 (mod 2k l) Now since (l) even,so gcd(2k1 , (l)) = 2r for some natural n.Then applying the fact ab = gcd(a, b).lcm(a, b) to the congruence above,we get that a 2r (m) 1 = a 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 primitive root.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 an odd prime and k is a positive integer. Corollary 1: If m = m1 m2 , gcd(m1 , m2 ) = 1 with m1 , m2 > 2 then m does not have any primitive root. Corollary 2: If m has two dierent prime factors than m has primitive root only for m = 2pk Now lets get back to the corollary of the converse theorem we proved which stated that (m) (m) 2 2 2 (1) 2 r1 r2 .....r2 (mod m) (m) a
2 2k1 (l)

k2

(2k ) 2

.We consider m > 2 has a primitive root,m = pk or m = 2pk In both cases,if p 1 (mod 4) then (m) = pk1 (p 1) which is divisible by 2 2 4 implying that r1 r2 ...r2 (m) 1 If p 3
2 2 (mod 4), then r1 r2 ...r2 (m) 1
2 2

(mod m)

So, using Jacobi symbol in the previous result we nd that if m = pk , p odd,then 1 2 2 2 2 2 r1 r2 ...r2 (mod m) when ( (m) 1 m ) = 1.Else r1 r2 ...r (m) 1.
2

If m 1
2

2 2 (mod 4),then r1 r2 ...r2 i r1 r2 ...r (m) (m) 1 =


2 2

(mod m)

where i 1 (mod m). 2 2 Also,r1 r2 ...r2 r1 r2 ...r (m) r (m) +1 .....r(m) i (m) 1 r1 r2 ...r(m) =
2 2 2

(mod m) In other words if r1 , r2 , ...., rpk1 (p1) are positive integers such that no ri have a prime factor p,then pk |r pk1 (p1) ....rpk1 (p1) r1 r2 ..r pk1 (p1)
2

+1

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

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

Some Congruences On Primes

In this section,we shall basically see whether a particular number can be the primitive root or not of a prime.Also is an integer is a perfect power modulo p.Lets consider 1 < a < p 1 in all cases.The modulo p will be taken throughout 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 : p 1 1 We will show that a = p 4 works here.So let,n = 4 . 1 i 2 Then 4n = p 1 1 (mod p), = n (mod p) where i2 1 4 (2) (mod p) and the existence of such i is guaranteed by P2 of Legendre symbol in the section Denitions. Consider two cases: p1 2 Case 1:p 5 (mod 8),then from Legendre symbol,we get ( p ) = 1, 2 2 1.Also i 1 1 1.
p 1 2

(1)

p1 4

i (mod 8).These two imply that aa ( 2 )


p1 p1

p 1 2

Case 2:p 1 (mod 8),then similarly we get 2 2 1.Also i 2 (1) 4 1. Thus it is true for both cases. Corollary 1: p 1 4 = prp if p 1 (mod p). This follows directly from the generalization of the corollary of lemma 1. Corollary 2: 1 a = p 4 is a perfect 4 th power of p. It is straight forward from the denition since (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 : 1 Several examples convince us that we should take a = p 2 this time.Lets try. p 1 p1 2 ) = 1, 2 2 .Moreover,(p 1) 2 Note that 2 is a qnr of p yielding ( p
1 (1) 2 1 yielding aa 1 1. Hence,the conclusion follows. Corollary 1: 1 a = p 2 is a perfect square of p 3 (mod 8). Corollary 2: 1 a = p 2 = prp for p 3 (mod 8).
p1

p 1

Claim 3: n1 1. Let n = p+1 2 , be positive integer where p 1 (mod 8).Then n 3 Example.p = 7, n = 4, 4 1 (mod 7). Proof : p 1 2 p 1 (mod 8) = ( p ) = 1 = 2 2 1 2p1 = p1 1 1.
2 1 1 n1 The rest is to just see that n = p+1 (2 ) 2 1. 2 2 and n Corollary 1: a = p+1 2 is a perfect square of p 1 (mod 8). Corollary 2: a = p+1 2 = prp for p 1 (mod 8). Claim 4: p3 4 Let p+1 2. 4 = n be a positive integer.We want to show that n Proof : 1 2 4n = p + 1 1 (mod 8) = n 1 4 2) . 1 Therefore,we may say that, n 2. p 1 3 1 4 Since p n 4 = 2 2 ,using this we get n desired. Corollary: p 3 2 1.If ( p ) = 1 or p 1 (mod 8),then n 4 2.
p 3 p3 p 1 2 2 p1

1 . (1 2) n

p1 2

.2 2,as

2 1.If ( p ) = 1 or p 3 (mod 8),then n 4 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).

You might also like