100% found this document useful (1 vote)
2K views132 pages

M. Sc. II Maths. Number Theory All

Uploaded by

Atul
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
100% found this document useful (1 vote)
2K views132 pages

M. Sc. II Maths. Number Theory All

Uploaded by

Atul
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 132

H I

SHIVAJI UNIVERSITY, KOLHAPUR


CENTRE FOR DISTANCE EDUCATION

Number Theory
(Mathematics)

For

M. Sc. Part-II : Semester-III

Paper (MT 303)

(Academic Year 2021-22 onwards)

K J
Unit-1
DIVISIBILITY

1.1 This chapter requires very basic ideas in mathematics. In fact high school
mathematics is enough. We now proceed to prove a theorem which is a foundation
stone for development in number theory.
Principle of well – ordering
Every non-empty set S of non-negative integers has a least element. That is, there is
a  S such that a  b , for all b  S .
Theorem. (Division Algorithm)
Given integers a and b with b  0, there exist unique integers q and r satisfying
a  bq  r , 0  r  b.
The integers q and r are called respectively quotient and remainder in the division of a by b .
Proof. Let us consider the set
S  a  xb : x is integer, a  xb  0 .
Claim : S is non-empty.
Consider x   | a | , then a  xb  a    a  b  a  a b  a  | a | 0.

Thus S is non empty. Thus by well – ordering principle S has a least element say r .
Clearly, 0  r .
Further, there is an integer q such that r = a – q b that is a = bq + r.
Claim: r  b .
Suppose on the contrary that r  b.
Consider a   q 1 b   a  qb  b  r  b  0 . Therefore, a   q  1 b  S . Thus

a   q  1  r  b  r  S ,
which contradicts minimality of r . Hence, r  b .
Thus, 0  r  b .
Uniqueness: Let if possible there be integers q ', r ' such that a  bq ' r ', 0  r '  b . Thus

bq  r  bq ' r '  r  r  b  q  q | r  r | b q  q .
Now, 0  r   b  b   r   0 . This together with 0  r  b , we obtain b  r  r  b .
Thus, r  r  b . Therefore, b q  q  r  r  b  q  q  1  q  q ' . Hence r  r . This
proves uniqueness.

Number Theory | 1
Corollary : If a and b are integers with b  0 , then there exist integers q and r such that
a  bq  r , 0r  b .
Proof. If b  0 there is nothing to prove. Suppose b  0 , then b  0 . Therefore, there exist
unique integers q and r such that a   b  q  r , 0  r  b . Thus, a  b  q   r , 0  r  b .
Hence, in any case a  bq  r , 0r  b .
Ex. 1. Square of an integer is of the form 4k or 4k + 1.
Solution. : We know that any integer is of the form 2k or 2k + 1. Therefore, square of an
2
integer is of the from  2k   4k 2 or (2 k  1) 2  4 k 2  4 k  1  4 k  k  1  1 , which is precisely
of the form 4k or 4 k  1 .
Notes : 1. Observe that what the above theorem says is that no integer of the form 4k + 2
or 4k + 3 can ever be perfect square.
2. Square of any odd integer is of the form 8k + 1.
a  a 2  2
Ex. 2. Show that the expression is an integer for all a  1 .
3
Solution. Any integer a  1 has one of the form 3k, 3k + 1 and 3k + 2.
a is the form of 3k : Consider
a  a2  2 3k  9k 2  2 
  k  9k 2  2  , which is an integer.
3 3
a is of the form 3k  1 : Consider
a  a2  2  3k  1 9k 2  6k  3
   3k  1  3k 2  2k  1 , an integer.
3 3
a is of the form 3k  2 : Consider

a a2  2  3k  2   9 k 2  12 k  6 
   3k  2   3k 2  4k  2  , an integer.
3 3
a  a 2  2
Thus is any case is an integer.
3
Ex.3. Prove that any integer of the form of 6k + 5 is also of the form 3j + 2 but not
conversely.
Solution. Any integer of the form 6k + 5 is can be written as
6k  5  6k  3  2  3  2k  1  2  3 j  2
The integer 8 is of the form 3j + 2 but not the form 6k + 5.

Number Theory | 2
Ex.4. The square of any integer is of the form 3k or 3k + 1.
Solution. Any integer a has one of the three form 3k, 3k + 1 or 3k + 2.
2
Form 3k :  3k   9 k 2  3  3k 2 

That is, of the form of 3k.


2
Form 3k + 1:  3k  1  9k 2  6k  1  3  3k 2  2k   1 .

That is the form of 3k + 1.


2
Form 3k + 2 :  3k  2   9k 2  12 k  4  3  3k 2  4 k  1  1

This is the form of 3k + 1


Ex. 5. Prove that 3 a 2  1 is never a perfect square .
Solution. We know that square of an integer is of the form 3k or 3k + 1 i.e. no number of the
form 3k + 2 can ever be a perfect square. Observe that,
3a 2  1  3  a 2  1  2 is of the form 3k + 2 and hence it can never be a perfect square.

Ex.6. Prove that cube of an integer has one of the form 9k, 9k + 1, 9k + 8.
Solution. Any integer has one of the forms 3k, 3k + 1 or 3k + 2.
3
Form 3k :  3k   27 k 3  9  3k 3  .

This is the form of 9k.


3
Form 3k + 1 :  3k  1  27 k 3  27 k 2  9 k  1  9  3k 3  3k 2  k   1 .

This is the form of 9k + 1.


3
Form 3k + 2 :  3k  2   27 k 3  54k 2  36k  8  9 3k 3  6 k 2  4 k   8 .

This is of the form 9k + 8.


Ex.7. Prove that for any integer a one of the integers a , a  2, a  4 is divisible by 3.
Solution. Any integer is of the form 3 k , 3k  1, or 3k  2 . Let a be of the form 3k then a is
divisible by 3, now if a is of the form 3k  1 , then a  2 is divisible by 3 and finally if a is
of the form 3k  2 , then a  4 is divisible by 3.
Ex.8. Prove that sum of squares of two odd integers cannot be a perfect square.
Solution,. We know that, square of an odd integers is of the form 8k + 1. There are two odd
integers so that sum of squares of two odd integers is of the form (8m + 1) + (8n + 1) =
8(m+n) + 2. That is, sum of squares of an odd integers is of the form 8k + 2 which can never
be a perfect square.
Ex.9. Prove that the product of four consecutive integer is 1 less than a perfect square.
Solution. It is enough to prove that
a  a  1 a  2  a  3  1 is a perfect square.

Number Theory | 3
Consider
a(a  1)(a  2)(a  3)  1  a (a3  6a 2  11a  6)  1 .
Also consider
2 2 2
 a  1 a  2   1   a  1  a  2   2  a  1 a  2   1

  a 2  2a  1 a 2  4a  4   2  a 2  3a  2   1

 a 4  4a 3  4a 2  2 a 3  8a 2  8a  a 2  4 a  4  2a 2  6 a  4  1
 a 4  6 a 3  11a 2  6 a  1

 a  a 3  6 a 2  11a  6   1 .
2
Thus a  a 3  6a 2  11a  6   1   a  1 a  2   1 .

(Also
2 2
 a  a  3   1  a 2  a  3   2 a  a  3   1

 a 2  a 2  6 a  9   2a 2  6a  1

 a 4  6 a 3  9 a 2  2a 2  6a  1
 a 4  6 a 3  11a 2  6 a  1

 a  a 3  6 a 2  11a  6   1

Thus,
2 2
a  a 3  6a 2  11a  6   1   a  1 a  2   1   a  a  3  1 )

Thus, a  a  1 a  2  a  3  1 is a perfect square.


Ex.10. Establish that the difference of two consecutive cubes is never divisible by 2.
Solution. Let the consecutive numbers be a and a1 .
3
Consider,  a  1  a 3  3a 2  3a  1  3a  a  1  1 .

Since a  a  1 is always of the form 2k, that is divisible by 2. Therefore difference of two
consecutive cubes is of the form 2k + 1 which is never divisible by 2.
EXERCISES 1.1.
1. The 4th power of any integer is either of the form 5k or 5k + 1.
n  n 1 2n 1
2. For n 1, prove that is an integer.
6
n  n  1 n  2
3. For n 1, prove that is an integer.
6

Number Theory | 4
1.2 Divisibility
Definition: Let a( a  0) and b be integers then we say that a divides b if there is an integer
c such that ac  b in this case we write a | b .
Theorem : For integers a, b, c the following hold
a) a | 0,1| a,a | a
b) a |1 iff a  1
c) If a | b and c | d , then ac | bd .
d) If a | b and b | c , then a | c .
e) a | b and b | a , iff a  b .

f) If a | b and b  0 , then a  b .

g) If a | b and a | c , then a | bx  cy for arbitrary integers x and y.


Proof. a) a  0  0  a | 0; 1  a  a  1 | a ; a  1  a  a | a .
b) a |1  ab  1 for some integer b  a  1 .

c) a | b and c | d  aa1  b and cc1  d  aa1  cc1  bd  ac  a1c2   bd  ac | bd .

d) a | b and b | c  aa  b and bb  c  aa  b  c  a | c .


e) a | b and b | a  aa  b and bb  a  aab  a  ab  1
 a  1 and b  1 .
Thus a  b .
f) a | b and b  0  aa  b with a   0  a a  b  a  b (because a'  1 ).

g) a | b and a | c  aa  b and aa  c  bx  cy  aa x  aa y  a  ax  ay  .

Thus a | bx + cy .
Definition (Common Divisor):Let a and b be two integers at least one of which is non zero,
an integer c is common divisor of a and b , if c | a and c | b .
Definition (Greatest Common Divisor):Let a and b be two integers at least one of which is
non zero. Then a positive integer d is a greatest common divisor of a and b if
a) d | a and d | b
b) whenever c is a positive integer such that c | a and c | b then c  d .
Theorem. Given integers a and b not both of which are zero, there exist integers x and y
such that gcd  a, b   ax  by .
Proof. Let us define
S  au  bv : au  bv  0, u, v are integers .

Number Theory | 5
Note that a  au  b.0 where u  1 and u  1 according as a  0 and a  0 . Therefore, S
is non-empty set of positive integers. Hence, we can invoke principle of well-ordering which
assures of a least positive integer d  S . Therefore, there exist integers x and y such that
d  ax  by .
By division algorithm there exists integers q and r such that,
a  dq  r , 0  r  d.

Then r  a  dq  a   ax  by  q  a 1  xq   b   yq  .

Hence, r  S . But it contradicts minimality of d unless r  0. Thus r  0. Therefore a  d q


and so d | a and similarly d | b .
Let c be a positive common divisor of a and b , then c | a and c | b hence c | ax  by  d .
Thus c | d . Therefore, c | c || d | d . Thus d is gcd of a and b .
Corollary – If a and b are given integers not both zero. Then the set
S  ax  by : x, y integers is precisely the set of all multiples of d  gcd  a, b .

Proof. Suppose d  gcd  a, b so that d | a and d | b . Hence, d | ax + by , that is, ax + by is


multiple of d. On the other hand d  gcd  a, b , then there exist integers u , v such that
d  au  bv. Therefore, cd  a  cu   b  cv  is of the form ax + by .
Definition (Relativity Prime integers)
Two integers a and b , not both of which are zero, are relativity prime if gcd  a, b   1 .

Theorem – Let a and b be integers, not both zero then a and b are relativity prime if and
only if there exist integers x and y such that 1  ax  by
Proof. Suppose a and b are relativity prime then gcd( a, b)  1 and there exist integers x and
y such that ax  by  1 . Conversely, suppose ax  by  1 . Let d  gcd  a, b , then d | a and d | b
. Therefore, d | ax  by  1 . Since d  0 and d |1 , we must have d  1. Hence, a and b are
relatively prime.
a b
Corollary 1.If gcd  a, b  d then gcd  ,   1 .
d d
a b
Proof. Suppose d  gcd  a, b , then d | a and d | b , so that and are integers. Since
d d
a b
d  gcd  a, b there exist two integers x and y such that d  ax  by so that 1  x  y .
d d
 a b 
Hence, gcd  ,   1 .
d d
Corollary 2. Let a | c and b | c with gcd( a, b)  1 , then ab | c .

Number Theory | 6
Proof. Since gcd( a, b)  1 and there exist integers x and y such that ax  by  1 , so that
c  c  1  c  ( ax  by )  ( ca ) x  (cb ) y . Since a | c and b | c there exist integers u and v such
that au  c and bv  c . Thus c  (ca ) x  (cb ) y  ( ab )vx  ( ab )uy  ( ab )(vx  uy ) . Therefore,
ab | c .
Note : Let a  6 , b  4 and c  12 . Here gcd(6, 4)  2  1 and 6 |12 also 4 |12 but 24 | 12 .
On the other hand, let a = 6, b = 4 and c = 24. Here gcd(6, 4) = 2  1 and 6 | 24 also 4 | 24
and 24 | 24. Therefore, gcd(a, b) = 1 is sufficient but not necessary for ab | c.
Theorem – (Euclid’s Lemma) If a | bc with gcd( a, b)  1 , then a | c .
Proof. Suppose gcd( a, b)  1 , then there exist two integers x and y such that ax  by  1 .
Thus c(ax  by )  c.1  c  acx  bcy  c. Since a | bc , a | acx  bcy  c.
Note. Consider the example, 12 | 6  8 with gcd(12, 6)  6  1 , here 12 | 8 .
Ex. Give integers a, b, c such that a | bc, gcd(a, b)  1 but still a | c. In other words gcd(a, b)
= 1 is sufficient but not necessary in the above result.
Theorem. Let a and b be integers not both zero. For a positive integer d , d  gcd(a, b) if
and only if
i) d | a and d | b
ii) whenever c | a and c | b , then c | d .
Proof.Suppose d  gcd( a, b) , then by definition (i) is obvious. Since d  gcd( a, b) , there
exist integers x and y such that d  ax  by . Now c | a and c | b implies c | ax  by  d .
Hence, c | d .
Conversely, suppose that the conditions hold. To prove that d  gcd( a, b) , the first
condition of gcd is already satisfied, so it remains to prove that the given conditions imply
the second condition of gcd. Suppose that c is a positive integer such that c | a and c | b , then
by hypothesis (ii), c | d this implies c | c || d | = d .
Least common multiple(lcm). The least common multiple of two nonzero integers a and b ,
denoted by lcm(a, b) , is the positive integer m satisfying the following conditions
i) a | m and b | m
ii) If a | c and b | c , with c  0 , then m  c .
Note: Given non zero integers a and b , lcm(a, b) always exists and that lcm(a, b) | ab | .
We shall now prove relation between gcd and lcm.
Theorem: Let a and b be positive integers then, lcm(a, b) gcd(a, b)  ab .
Proof.Let d  gcd( a, b) , then d | a and d | b , so that there exist integers r and s such that
ab
a  dr and b  ds . Let m  , then m  rb and m  as so that a | m and b | m , that is m
d
is common multiple of a and b .

Number Theory | 7
We shall prove that m is lcm of a and b . Let c be a positive common multiple of a and b .
Then c  au  bv for some integers u and v . Since d  gcd( a, b) , there exist integers x and
y such that d  ax  by . Consider
c cd cd c(ax  by ) c c
    x  y  vx  uy  Since md = ab 
m md ab ab b a
c ab
which is an integer. Thus  1  c  m . Therefore, m  lcm(a, b) . Thus lcm(a, b)  ,
m d
that is lcm(a, b) gcd(a, b)  ab .
We shall now go through some illustrative examples
Ex.1. Prove that, for a positive integer n and any integer a,gcd  a, a  n  divides n, hence
gcd  a, a  1  1 .
Solution. Let d  gcd( a, a  n) , then d | a and d | a  n implies d | a  n  a  n .

Thus if d  gcd  a, a 1 then d |1  d  1 .

Ex.2. Assuming that gcd  a, b   1 prove that gcd  a  b, a  b   1 or 2 .

Solution.Let d  gcd( a  b, a  b) , then d | a  b and d | a  b .


Thus d | ( a  b)  ( a  b)  2a and d | ( a  b)  ( a  b)  2b .
Since gcd( a, b)  1 , there exist integers x and y such that ax  by  1 . Therefore,
d | 2( ax  by )  2(1)  2 . Thus d  1 or d  2 .

Ex.3. Prove that, if a and b are both odd integers then 16 | a 4  b 4  2 .


Solution. We know that the square of an odd integer is of the form 8k + 1. Hence
2 2
a 4  b 4  2   8m  1   8n  1  2 . = (64 (m2+n2) + 16 (m+n)
= 16 [4(m2+n2) + (m+n)
4
Thus 16 a  b4  2

Lemma. If a  bq  r , then gcd  a, b  gcd  b, r  .

Proof. Let d = gcd (a, b) then d | a and d | b. Let d' = gcd (b, r). Now d | a and d | b ⇒ d | a –
bq = r and d | b ⇒ d | b and d | r ⇒ d ≤ d'. On the other hand d' = gcd (b, r) ⇒ d' | b and d' | r
⇒ d' | bq + r and d' | b ⇒ d' | a and d' | b ⇒ d' ≥ d. Thus d = d', that is, gcd (a, b) = gcd (b, r)
Using this lemma we can find gcd of given two numbers as follows.
Ex.1 Find gcd 12378,3054 and express gcd 12378,3054 as 12378 x  3054 y .

Solution. Consider
12378 = 3054 x 4 + 162
3054 = 162 x 18 + 138

Number Theory | 8
162 = 138 x 1 + 24
138 = 24 x 5 + 18
24 = 18 x 1 + 6
18 = 6 x 3 + 0
Thus gcd 12378,3054  6 .

(Note. We can find gcd in fewer steps as follows.


12378=3054x4 + 162
3054=162x19 – 24
162=24x7 – 6
24=6x4 + 0 .
What we have done here is that of the two possible remainders162(12378=3054x4 + 162)
and 162 – 3054 = - 2892 (12378=3054x5 – 2892 ) we choose numerically smaller value 162,
further, we choose 24 from the two possible values 138 and 138 – 162 = - 24. This technique
reduces number of steps. )
Here, gcd(12378,3054)=gcd(3054,162)=gcd(162,138)=gcd(138,24)=gcd(2,18)=6.
Now, we shall express gcd as 12378 x  3054 y .
6 = 24 – 18 x 1
= 24 – (138 – 24 x 5 )
= - 138 + 24 x 6
= - 138 + (162 – 138 x 1 ) 6
= 162 x 6 – 138 x 7
= 162 x 6 – (3054 – 162 x 18) x 7
= 162 x 132 – 3054 x 7
= (12378 – 3054 x 4) x 132 – 3054 x 7
= 12378 x 132 + 3054 ( - 535)
Thus 6 = 12378 x 132 + 3054 ( - 535) .
Theorem. If k  0, then gcd  ka, kb  k  gcd  a, b .

Proof. Let d  gcd  a, b then d | a and d | b . Therefore for any k  0, kd  0 and kd | ka also
kd | kb . Let c be a positive integer such that c | ka and c | kb . Since d  gcd  a, b , there exist
integers x and y such that d  ax  by . Thus c | ka and c | kb  c | k  ax  by   kd . Hence,
kd  gcd  ka, kb  . Thus, gcd  ka, kb  k  gcd  a, b .

Corollary. For any integer k  0 , gcd  ka, kb  k gcd  a, b .

Proof. If k  0 there is nothing to prove. Let k  0 , then there is m  0 such that k  m .

Number Theory | 9
Therefore, gcd  ma, mb   m  gcd  a; b   gcd  ka, kb  k  gcd  a, b  . Hence,
gcd  ka, kb  k  gcd  a, b .

Exercises 1.2.
1. If a | b , show that (  a) | b, a | ( b), (  a) | ( b) .
2. If a | b , then prove that a | bc .
3. If a | b , then prove that ac | bc . Is the converse true.
4. Prove or disprove. If a | b  c then a | b or a | c .
5. Assuming that gcd( a, b)  1 , prove that gcd(2a  b, a  2b)  1 or 3.
6. If gcd( a, b)  1 , then for any nonzero integer c , gcd( ac, b)  gcd(c, b) .

7. Use Euclid’s algorithm to find integer x and y such that , gcd  56,72  56x  72 y .

8. Use Euclid’s algorithm to find integer x and y such that ,

gcd 143,227   143x  227 y .

1.3. Diophantine Equations


In general any equation in one or more unknowns which is to be solved in integers is
Diophantine equation.
The name honours the Greek mathematician Diophantus. There is an interesting
problems saying something about how long did Diophantus lived?
Ex.1. His boyhood lasted 1/6th of his life; his beard grew after 1/12th more, after 1/7th more
he married, and his son was born 5 years later. The son lived to 1/2th his father age and the
father died after four years after his son
Solution. Let x be the age of Diophantus when he died. From the given information we have
1 1 1 1
x x x5 x4  x
6 12 7 2
1 1 1 1
 x x x x9  x
6 12 7 2
2 1 1 1
 x x x x9  x
12 12 7 2
2x  x  6x 1
  x9 x
12 7
9x 1
  x x9  0
12 7

Number Theory | 10
7  9 x  12 x  84 x
 9  0
84
63 x  12 x  84 x
 9  0
84
3x 3x
 9  0 9   3 x  252
28 28
 x  84.
Note. Diophantine equations may be of any degree and in any number of (variable)
unknowns. However in this course, we are interested in linear Diophantine questions of the
form ax  by  c . A Diophantine equation may have number of solutions.
e.g. 3.4 + 6.1 = 18 ,
3.2 + 6.2 = 18 .
3( - 2) + 6.4 = 18 .
That is (4, 1), (2, 2), ( - 2, 4) are all solutions of 3 x  6 y  18 .
Theorem. The linear Diophantine equation ax + by = c has a solution if and only if d | c
where d  gcd  a, b . If x0 , y0 is any particular solution of this equation then all other
b a
solutions are given by x  x0    t, y  y0    t where ‘t’ is any arbitrary integer.
d  d 
Proof – Let d  gcd  a, b then d | a and d | b . Suppose ax + by = c has a solution, that is,
there exist integers x and y such that ax + by = c . Since d | a and d | b , we have
d | ax + by = c . Thus d | c .

Conversely, suppose that d | c . Since d  gcd  a, b , there exist integers x0 and y0 such that
d  ax0 by0 . Since d | c there is an integer r such that dr  c .Thus ,
c  dr   ax0  by0  r  a  x0r   b  y0r 

Hence x  x0r, y  y0r is a solution of ax  by  c .


This proves the first part of the theorem.

Suppose that, ax + by = c has a solution  x0, y0  then ax0 by0  c .


Let  x, y  be any solution of ax + by = c , then

ax by  ax0  by0  a  x  x0   b y  y0  ------------------- (1)

Since d  gcd  a, b , there exist relatively prime integers r and s such that , dr  a and
ds  b . Thus (1) becomes
dr  x  x0   ds  y0  y 

Number Theory | 11
 r  x  x0   s  y0  y 

Since r | r  x  x0   s  y0  y  and gcd  r , s   1 by invoking Euclid’s lemma ,we obtain

r | y0  y .
Therefore, there is an integer ‘t’ such that
y0  y  rt
 y  y0 rt
a
 y  y0    t
d 
Further, x  x0  st
 x  x0  st
b
 x  x0    t
d
b a
Let x1  x0  t and y1  y0  t , then
d d

 b   a 
ax1  by1  a  x0  t   b  y0  t   ax0  by0  c .
 d   d 
b a
Thus every other solution of ax + by = c is of the form x  x0  t and y  y0  t
d d
where ‘t’ is an arbitrary integer.
Note.Thus there are infinitely many solutions of the given equation, one for each value of ‘t’.
Ex.1. Solve 172 x  20 y  1000 .

Solution. Here gcd 172,20   4 and 4 | 1000 . Therefore given Diophantine equation has a
solution.
Consider,
172  20  8  12
20  12 1  8
12  8 1  4
8  4 2  0 .
Thus gcd 172,20  4 . Now

4  12  8 1
 12   20 12 11
Number Theory | 12
 12  2  20
 172  20  8  2  20
 172  2  20 17
4  172  2  20  17
Thus
4  172  2  20  17
Multiplying both sides by 250, we obtain
1000  172  500  20  4250

Thus,  500, 4250 is a solution of given Diophantine equation.


General solution of given Diophantine equation is
b 20
x  x0  t  500  t  500  5t
d 4
and
a 172
y  y0  t  4250  t  4250  43t .
d 4

Thus,  500  5t, 4250  43t  is general solution where ‘t’ is an arbitrary integer.

We can proceed further to test whether the given equation has positive solution.
Consider,
500  5t  0 and 4250  43t  0
 4250 -98.8
 t  100 and t    98.8 *
43 -100 -99 -98
 t  99
 x  5 and y  7
Thus (5, 7) is the positive solution and that it is only positive solution.

Corollary. If gcd  a, b   1 and it x0 , y 0 is particular solution of linear Diophantine equation


ax + by = c then all the solution are given by, x = x0 + bt, y = y0 - at .
Note : Certain Diophantive equations need not have positive solution at all.
Note. Each of the following Diophantine equations do not have solution.
a) 6 x  51 y  22
b) 33 x  14 y  115
c) 14 x  35 y  93 .

Number Theory | 13
Ex.2. Determine all solution in the integers of the following Diophantine equation
a) 5 6 x  72 y  4 0 ,
b) 24 x  138 y  18 ,
c) 221 x  35 y  11 .
Solution. a) First of all we shall find the gcd of 56 and 72. Consider
72  56 1  16
56  16  3  8
16  8  2  0 .
Thus gcd  56,72   8 and that 8 |16 , therefore solution exists.

Now 8  56 16  3

 56  3   72  56

 56  4  72   3 .

Thus, 8  56  4  72   3 .
Multiplying both sides by 5, we get,
40  56  20  72   15 .
Thus, (20, - 15) is solution of given Diophantine equation.
General solution of given Diophantine equation is
b a
x  x0  t y  y0  t
d d
72 56
x  20  t y   15  t
8 8
x  20  9t y   15  7 t .

Thus,  20  9t, 15  7t  is general solution,where ‘t’ is arbitrary integer.

We can proceed further to test whether the given equation has positive solution.
Consider,
20  9t  0 15  7t  0
 20  15
t t
9 7
t  2.22 t  2.14 .
Observe that there is no integer t satisfying the given conditions. Hence, there is no positive
solution.
b) 24 x  138 y  18

Number Theory | 14
Here gcd  24,138  6 and that 6|18.

Therefore, the given Diophantine equation has a solution.


Consider,
138  24  5  18
24  18 1  6
18  6  3  0
Thus, gcd  24,138  6 . Now
6  24 18 1
 24  138  24  5 

 24 6 138 1 .


Thus
6  24  6  138  1 .
Multiplying both the sides by 3.
18  24 18 138  3
Thus (18, - 3) is solution of given equation. The general solution of the given equation is
b a
x  x0  t y  y0  t
d d
138 24
x  18  t y   3   t
6 6
x  18  23t y   3  4 t .

Thus, 18  23t, 3  4t  is general solution, where ‘t’ is arbitrary integer.


We can proceed further to test whether the given equation has positive solution.
Consider,
18  23t  0 3  4t  0
23t  18 4t  3
 18 3
t t .
23 4
 t  0.7826 t  0.75 .
Observe that there is no integer t satisfying the given conditions. Hence, there is no positive
solution.
c) 221x  35 y  11 .
Here gcd (221, 35) = 1 and 1|11

Number Theory | 15
Therefore the given Diophantine equation has a solution.
Consider,
221  35  6  11
35  11 3  2
11  2  5 1
2  2 1  0 .
Therefore, gcd  221,35  1.

Now 1  11  2  5
 11  5  35 113

 35  5 1116

 35   5  16   221 35 6 .

Thus 1  22116  35   101 .


Multiplying on both sides by 11, we get
11  22116  35  1111 .

Thus 176, 1111 is solution of given Diophantine equation.


General solution of given Diophantine equation
b a
x  x0  t y  y0  t
d d
35 221
x  176  t y   1111  t
1 1
x  176  35t y   1111  221t

Thus, 176  35t , 1111  221t  is general solution.Where ‘t’ is arbitrary integer.

We can proceed further to test whether the given equation has positive solution.
Consider,
176
176  35t  0  t   t  5.028
35
and
1111
1111  221t  0 implies t   t  5.0271 .
221
Observe that there is no integer t satisfying the given conditions. Hence, there is no positive
solution.

Number Theory | 16
Ex.3. A customer brought a dozen pieces of fruit apples and oranges, for $1.32. If an apple
costs 3 – cents more than an orange and more apples than oranges were purchased. How
many pieces of each kind were brought?
Solution – Let x be the number of apples and y be the number of oranges. Let z be the cost of
oranges .
Then, x  y  12 (1)

And  z  3 x  zy  132 (2)


From (2) we have
z  x  y   3x  132
 12 z  3x  132
 4 z  x  44 (3)

Here gcd 1, 4   1 and 1|44 Hence, Equation (3) has a solution. Now
1  4 1  1 3

 44  4  44 1 132 


Thus (44, - 132) is a particular solution .
General Solution is,
z  44  t , x  132  4t (4)
where t is any integer.
For positive solution we must have
44  t  0 and 132  4t  0

 t  44 and t  33  44  t  33 .


We shall now prepare the table of permissible values of x,y and z. In view of Equation(1) and
Equation (4), we have
t z x y (z + 3) x + zy
- 35 9 8 4 132
- 34 10 4 8 132
Thus x  8, y  4 or x  8, y  4 are two possible solutions.
We have not listed other values of t because the values of x or y is zero or negative in those
cases.
Since number of apples is more than oranges x = 8, y = 4 is the solution.
Ex. 4. If a cock is worth 5 coins a hen 3 coins and three chicks together 1 coin how many
cocks, hens and chicks totaling 100 can be brought for 100 coins.

Number Theory | 17
Solution. Let x be the number of cocks y be the number of hens and ‘z’ be the number of
chicks.
z
Then 5 x  3 y   100
3
And x  y  z  100
Thus 15 x  9 y  z  300 , (1)
x  y  z  100 . (2)
From (1) and (2) we obtain
4 x  8 y  200 .

That is 7 x  4 y  100 . (3)

Here gcd  7, 4   1|100 . Hence equation (3) has a solution .

Now 1  7  1  4  2   100  7   100   4  200  .


Thus, (- 100, 200) is a particular solution of given Diophantine equation.
General solution is
b a
x  x0  t y  y0  t
d d
4 7
 100  t y  200  t
1 1
x  100  4t y  200  7 t .
where t is any integer.
For positive solution we must have
100  4t  0 and 200  7t  0
200
25  t  0, t   29
7
Thus, 25  t  29
We can now prepare table of possible solutions.
t x y z 15x + 9y + z
26 4 18 78 300
27 8 11 81 300
28 12 4 84 300.
Exercises 1.3
1. Determine all the solutions in the positive integers of the following Diophantine
equations
a) 18x+5y=48

Number Theory | 18
b) 54x+21y=906
c) 158x – 57y =7
(Ans. a) (1,6) b) (2,38), (9,20), (16,2) c) (17 - 57t , 47-158t) where t  0 )
2. A certain number of sixes and nines is added to give a sum of 126;if the number of sixes
and nines is interchanged, the new sum is 114.How many of each were there originally?
(Ans.six 6’s and ten 9’s)
3. When Mr. Smith cashed a cheque at his bank, the teller mistook the number of cents to
the number of dollars and vice versa. Unaware of this , Mr. Smith spent 68 cents and
then noticed to his surprise that he had twice the amount of the original cheque.
Determine the smallest value for which the cheque could have been written.
(Ans. $10.21)


Number Theory | 19
Unit-2
PRIMES AND THEIR DISTRIBUTION

2.1 Fundamental Theorem of Arithmetic


Definition. An integer p  1 is a prime integer or simply a prime if it’s only divisors are 1
and p . An integer greater than 1 that is not prime is called composite integer.

Theorem. If p is a prime and p | ab then p | a or p / b .

Proof. If p | a then there is nothing to prove.

Suppose p | a then p being prime its only divisors are 1 and p, therefore gcd  p, a   1or
p . If gcd  p, a   p then p | a , which is absurd.

Hence gcd  p, a   1. Then by Euclid’s lemma p | ab and gcd  p, a   1 together give us


p|b.

Corollary. If p is prime and p | a1a2 ...an then p | ak for some 1  k  n .

Proof. We shall prove this by induction on n .

Suppose n = 2, then p | a1a2  p | a1 or p | a2 by known result. Hence the result


holds for n  2 .
Suppose the result holds for n = m and
Consider.

p | a1a2 ...am am1

 p | ( a1a2 ...am )am1

 p | a1a2 ...am or p|am1

 p | ak for some 1  k  m or p|am1

 p | ak for some 1  k  m  1

Hence , the result holds for n  m  1 whenever it holds for nm .


Therefore, by principle of mathematical induction the result holds for any n.

Theorem. If p,q1 ,q2 ,...qn are all primes and p | q1q2 ...qn then p  qk for some k, 1  k  n
.

Number Theory | 20
Proof. In view of the above corollary, p | q1q2 ...qn implies p | qk for some 1  k  n Since
both p and qk are primes and that qk > 1, p > 1 we have p  qk .

Theorem. (Fundamental Theorem of Arithmetic)


Every positive integer n >1, can be expressed as product of primes, this representation is
unique apart from the order in which the factors occur .
Proof. If n is prime there is nothing to prove. Suppose ‘n’ is composite, then there exist an
integer d >1 such that d|n with 1 < d < n. Thus there is a set of divisors of n such that 1 < d <
n. Therefore, there is a smallest integer p1 such that 1 < p1 < n and p1 | n .

Claim : p1 is prime.

Suppose on the contrary that p1 is composite integer, then there is a divisor q 1  q  p1  of


p1 which is ultimately a divisor of n, which contradicts minimality of p1 .Hence p1 is prime.
Thus we have n = p1n1 , where p1 is prime and n  n1 . If n1 is prime, we are done, otherwise
there is prime p2 dividing n1 .Let n1 = p2 n2 with n > n1 > n2 . If n2 is prime we stop here.
Otherwise there is a prime p3 and n2 = p3n3 with n > n1 > n2 > n3 . Since n is finite the
above process can not be continued indefinitely, that is to say, there is a positive integer r
such that nr-1 = pr qr where pr and q r are primes.

Thus n = p1 p2 ... pr qr is prime factorization of n > 1.

Uniqueness :Let q1 , q2 ,..., qs be primes such that, n  p1 p2 ... pr  q1q2 ...qs where pa ,... pr
and qa ,...qs are primes written in increasing order, that is p1  p2  p3  ...  pr and
q1  q2  ...  qs .

Now, p1 | p1 p2 ... pr  q1q2 ...qs  p 1  q k for some 1  k  s .

By hypothesis p1 = qk  q1 . Thus p1  q1 .Now, starting with q1 instead of p1 we obtain


p1  q1 .Thus p1  q1 . Therefore, we have p2p3...pr = q2q3...qs Repeating the above process we
obtain l = qr+1 ... qs .This is possible only if r  s and pk = qk for all k .
Hence the uniqueness.
Corollary. Any positive integer n > 1, can be written uniquely in the canonical form n =
p1k1p2k2 ... prkr where for i = 1, 2, ... r each k r is a positive integer and each pi is a prime
with p1  p2  ...  pr .
Proof. Proof is immediate from the above theorem.

Theorem. The number 2 is irrational.

Number Theory | 21
Proof. Suppose on the contrary that 2 is rational, then there exist integers a, b  0 such
a
that 2 , where gcd  a, b   1 .Squaring both sides, we obtain 2b 2  a 2 .
b
If b > 1, then by Fundamental theorem of arithmetic, there is a prime p such that p | b.
Hence, p | a2 , but then p | a ,so that gcd  a, b   p , which is impossible. Thus we have b  1
so that a 2  2 and there is no integer a whose square is 2. Hence, we arrive at contradiction.
Therefore 2 is irrational.
Ex. 1 Prove that any prime of the form 3n  1 is also of the form 6 m  1 .
Solution. For 3n  1 is to be odd we must have 3n to be even and hence n must be even.

Ex.2 Every integer of the form n 4  4 is composite for n > 1.


Solution. Observe that

n 4  4  n 4  4n 2  4  4n 2
2 2
  n 2  2    2n 

  n 2  2  2n  n 2  2  2n  ,

which is composite for n>1.

Ex.3 The only prime of the form n 2  4 is 5


Solution. For n  3, n 2  4  5 and for n  4 , we have n2 – 4 = (n + 2) (n – 2), which is
composite.
Ex.4 . Prove that every number of the form 3n + 2 has a prime factor of the same form.
Proof. We know that product of any number of integers of the form 3n+1 is also a number of
the form 3n+1 and that product of any number of integers of the form 3n is also a number of
the form 3n. Therefore, the prime factorization of any number of the form 3n+2 must contain
a prime of the form 3n+2.
Theorem(Euclid’s Theorem). There is an infinite number of primes.
Proof. Let p 1 = 2 , p 2 = 3 , p 3 = 5 , p 4 = 7 ,... be primes in natural order. If possible there be
last prime p n . That is p 1 , p 2 , ..., p n are the only primes.

Consider
P = p 1 p 2 ... p n + 1

Clearly, P  1 therefore, by Fundamental theorem of Arithmetic P has a prime factor p.


which is one of p 1 , p 2 , ..., p n . Therefore p | p 1 p 2 ...... p n . Further p | P

Number Theory | 22
Thus p | P - p 1 p 2 ...... p n = 1 . Therefore, p | 1 which is absurd.

Hence, the infinitude of primes.


Note. Let p  denote the product of primes less than or equal to p, where p is prime.
Consider p  + 1
This number is called ‘Euclid’s number’ or ‘Euclidean number’
Consider,

3  2 # 1  2  1
7  3 #  1  2.3  1

31  5 #  1  2. 3. 5.  1
211  7 #  1  2.3 .5 .7  1
2311  11 #  1  2.3.5.7.11  1
All numbers of the form p # 1 need not be prime.

Let n1 2

n 2 = n1 + 1

n 3 = n 2  n1 + 1

n 4  n 3  n 2  n1  1

.
.
.
n k  n k -1 n k - 2 ...n 1  1

.
.
.

Since each n k  1, each n k has a prime divisor. Interestingly no two n k ’s have same prime
divisor.
Let,

d  gcd  ni , nk  where i  k .

Suppose d | n i then as i  k ,d | n 1 n 2 n 3 ...n k -1

Number Theory | 23
Further d | n k  d | n k - n 1  n 2 .... n k -1  1

Thus d = 1

Hence gcd  ni , nk   1 .

Thus, there are atleast as many different prime as different nk’s. Therefore primes are infinite
in number.
Now, let us come back to primes p 1 , p 2 ,..., p n ... in natural order. Consider
P = p 1 p 2 ... p n -1  1 .

Then prime divisor p of P is none of p1 , p 2 , ..., p n -1 .Therefore p n  p .

In other words, if there are several such primes p dividing P then p n can not exceed
the smallest of these. That is p n  p 1 p 2 ... p n -1  1  n  2

With slight modification, we can write

p n  p 1 p 2 ... p n -1 - 1  n  3 .
n1
Theorem. If p n is the nth prime number then pn  22 .
n 1
Proof. We shall prove this theorem by induction on n. For n  1, p 1  2 and 2 2  2.
Thus the results holds. Let the result hold true for all integers < n.
We know, p n  p 1 p 2 . .. p n  1  1
2 n2
 2  2 2  2 2  ...  2 2 1
2
 ...  2 n  2
 2 1 2  2 1
n 1
 22 1
1
n 1 n 1
 22 1
 22 1

n 1
 22
n1
Thus pn  22 .

Hence, the result holds true for n. Therefore, by principle of induction the result holds for any
n.
From this theorem following result follows immediately.

n
Corollary .There are at least n + 1 primes less than 22 .
n
Proof. From the above theorem p 1 , p 2 ,..., p n are primes less than 22 .

Number Theory | 24
Exercises 2.1

1. Exhibit five primes of the form n 2  2 .

2. Prove that the only prime of the form n3  1 is 7.

3. Find four primes of the form 2n  1 .


4. Find prime factorizations of the integers 1234 and 10140.

5. If n  1 is an integer not of the form 6 k  1 , prove that either 2 or 3 divides n 2  2n .

6. Prove that any integer of the form 8k  1 , where n  1 , is composite.


7. Find all primes that divide 50! .

8. If p  5 is a prime number, show that p 2  2 is composite.

2.2 SIEVE OF ERATOSTHENES

Let a  1 be a composite number then there exist integers b, c 1  b  a;1  c  a  such that
a  bc . Assuming b  c , we have b 2  bc  a and hence b  a . Since b  1 , b has a

prime factor p . If p is prime divisor of b  1, then p | b  p | a and that p  b  a . Thus


a composite number a always posseses a prime divisor p  a .

Therefore to find a prime factors of any integer a  1 . It is enough to test the primes less
than a . More precisely the number 100 has a prime factor which is one amongst 2, 3, 5,
7. Infact 1 00  2 2 .5 2 .
Let us consider the number a = 2093. Here the smallest prime dividing a is 7 and so 2093
= 7 x 299. Further smallest divisor of 299 is 13, thus 299=13x23. Thus a  7  13  23 .

Let us consider the application of sieve of Eratothenes to obtain all the primes less than 100.
1 2 3 4 5 6 7 8 9 10

11 12 13 1 4 15 16 17 18 19 20

21
  22 23 24 25 26 27 28
 29 30

31 32 33 34 35 36 37 38 39 40

41 42
 43 44 45 46 47 48 49
  50

51 52 53 54 55 56 57 58 59 60

61 62 63 64 65 66 67 68 69 70


71 72 73 74 75 76 77
 78 79 80
Number Theory | 25
81 82 83 84 85 86 87 88 89 90

91
  92 93 94 95 96 97 98
 99 100

Begin with 2 and score off all the multiples of 2 higher than 2 higher than 2. Then take 3 and
score off all multiples of 3 other than 3. Repeated it for 5, 7 and the integers that survise
scoring off are the primes less than 100.
Primes less than 100 are,
2, 3, 5, 7, 11,13, 17, 19, 23, 29, 31, 37, 41, 43, 47, 53, 59, 61, 67, 71, 73, 79, 83, 89, 97
Exercises 2.2

1. Determine whether the integer 501 is prime by testing all primes p  501 as possible
divisors.
2. Apply sieve of Eratosthenes to obtain all primes between 200 and 300.
3. Show that any composite three digit number must have a prime factor less than or equal
to 31. What can be said about four digit number?

2.4 Goldbach Conjecture


The difference between consecutive primes could be small as with the pairs 11, 13 and 17,
19 and for that matter 1,000,000,000,061 and 1,000,000,000,063. We call such pairs as twin
primes i. e. pair of primes of the form p and p + 2. The electronic computers have discovered
152892 twin primes < 3, 000,000,0 and 20 pairs between 10 12 and 1012  10000 .
The largest twin prime pair known is 3756801695685 · 2666669 ± 1(as of January 2016)

Proposition. Given any positive integer n, there exist n consecutive integers, all of which are
composite.
Proof. Given an integer n, n – consecutive composite integers are

 n  1! 2,  n  1 ! 3,...,  n  1 !  n  1 .
e.g. 5! + 2 = 2 x 61
5! + 3 = 3 x 41
5! + 4 = 4 x 31
5! + 5 = 5 x 25.

Goldbach Conjecture: Every even integer greater than 4 can be written as sum of two odd
primes.

Number Theory | 26
e.g. 6=3+3
8=5+3
10=5+5=3+7
12=5+7
14=11+3=7+7
16=3+13=5+11
18=7+11=5+13
20=7+13=3+17 …
Though this appears to be simple no proof has been found till todate. It is still an open
problem.
It has been verified by computation for all even integers less than 4  1011 , G.H. Hardy in his
address to the mathematical society of Copenhagen in 1921 stated that the Goldbach
conjecture appeared. “…Probably as difficult as any of the unsolved problems in
mathematics”. It is currently known that every even integer is the sum of 6 or fewer primes.
Lemma. The product of two or more integers of the form 4 n  1 is in the same form
Proof. Let 4 m  1 and 4 n  1 be two integers then

 4 m  1 4 n  1  16 mn  4  m  n   1  4  4 mn  m  n   1 .
which is of the form 4 n  1 .
Theorem. There is an infinite number of primes of the form 4 n  3
Proof. Suppose that there are only a finite number of primes of the form 4 n  3 , namely
p1 , p 2 , ..., p r .

Consider, N  4 p 1 p 2 ... p r  1  4  p1 p 2 ...... p r  1  3 .

Clearly, N > 1 and is of the form 4 n  3


Since N > 1, it has prime factorization N  q 1 q 2 ......q s . Further N being odd number
q k  2 1  k  s  . If some qk divides 4 p 1 p 2 ...... p r then as qk | N

q k | 4 p 1 p 2 .... p r  N  1  q k | 1  q k  1 which is absurd. Thus qk is other than p1, ..., pr


for  k  s

Further, each qk 1  k  s  , being odd it is of the form 4 n  1 or 4 n  3 . Since N is of


the form 4 n  3 , all qk ' s can not be of the form 4 n  1 because product of finite number of
integers of the term 4 n  1 is of the same form. Therefore, there is atleast one qk of the form

Number Theory | 27
4 n  3 . Thus qk is a prime of the form 4 n  3 other than p1 , p2 ,..., pr . Thus we arrive at
contradiction .
Therefore there are infinitely many primes of the form 4 n  3 .

Theorem. If all the n  2 terms of the arithmetic progression p, p + 2d, ..., p+ (n – 1)d are
prime numbers then the common difference d is divisible by every prime q < n.
Proof. Let q be a prime less than n. Let if possible q | d .

Claim. The first q terms of the progression namely, p, p  d ,..., p   q  1 d will leave
different remainders upon division by q.

Suppose on the contrary that p  rd and p  sd  0  r  s  q  leave the same remainder


upon division by q. Then p  rd  q1q  r and p  sd  q2 q  r , where q1 and q2 are quotients.
Therefore, ( s  r )d  (q2  q1 )q . Thus q |  s  r  d .Since ‘q’ is prime and q | d ,gcd  q, d   1
.Hence by Euclid’s lemma, q |  s  r  which is absurd as 0  r  s  q .

Hence, the claim.

Since the q integers p, p  d , p  2d ,.... p   q 1 d leave different remainders upon


division by q, one of the above q numbers will leave remainder 0. Note that the q remainders
upon division by q are 0, 1, 2, …,q – 1 . Let 0  t  q be such that q | p  td .Note that if p <
n, then one of the members of the progression p, p + d, … ,p + (n – 1) d is of the form p + pd
= p(1 + d), contradicting the fact that all members of the progression are primes. Therefore,
we have q  n  p  p  td .

Thus, we arrive at the conclusion that p  td is composite, which is absurd.


Therefore, q | d .

(e.g. p = 5, n = 7, d = 4, one of 1, 2, …., (7 - 1) is p = 5 and one of p, p  d ,


p  2d,...p   n  1 d namely 5, 5 + 4, 5 + 2  4, 5 + 3  4, 5 + 4  4, 5 + 5  4, 5 + 6  4
is 5 + 5  4 that is p  pd form. And also n = 3, p = 3, d = 4, q = 2 < 3 = n, consider 3, 3 + 4
= 7, 3 + 2  4 = 11 are all primes. Here q = 2 divides d = 4.)


Number Theory | 28
Unit – III
CONGRUENCES

3.1 Properties of Congruences:


Definition. Let n be a positive integer, then two integers a and b are said to be congruent
modulo n written as a  b  mod n  if and only if n | a  b , that is , a  b  kn , for some
integer k .
Let us take n  9 , then
25  7(mod9),  23  4(mod9), 39  6(mod9),  41  5(mod9) ,

because 25  7  2(9), 23  (4)  3(9),36  (9)  5(9), 41  (5)  4(9) .

Note. Congruence relation is an equivalence relation.


Let a and n be a given integers, then there exist integers q and r , such that
a  qn  r ,0  r  n . Observe that in this case a  r (mod n) . Thus every integer is congruent
modulo n to one of the integers 0,1, 2,, n  1 . In particular, a  0(mod n) if and only if
n | a . The set of integers 0,1, 2,, n 1 is called the set of least nonnegative residues modulo
n . Moreover, the set of integers a1 , a2 ,  , an is said to be complete set(system) of residues
modulo n , if every integer is congruent modulo n to one and only one of ak . In other
words, a1 , a2 ,  , an is congruent modulo n to 0,1, 2,, n  1, taken in some order. For
example, 14, 16,15, 23,31, 41, 45 is complete set(system) of residues modulo 7; Here, we
have
14  0, 16  5,15  1, 23  2,31  3, 41  6, 46  4 .

Theorem. For arbitrary integers a and b, a  b  mod n  if and if only a and b leave the same
remainder upon division by n.

Proof. Suppose a  b  mod n  , then a  b  qn for some integer q. By division algorithm


there exist integers q1 and r such that a  nq1  r , 0  r  n , then a  b  qn gives us

nq1  r  b  qn
 b   q1  q  n  r .

Thus a and b leave the same remainder upon division by n .


Conversely, suppose that a and b leave the same remainder on division by n, then
a  q1n  r and b  q2 n  r where q1 , q2 are quotients and r is remainder on division by n .

Number Theory | 29
Thus, a  b   q1  q2  n  a  b  mod n  .

Theorem. Let n  0 be fixed and a, b, c, d be arbitrary integers. Then the following


properties hold

a) a  a  mod n  .

b) If a  b  mod n  then b  a  mod n  .

c) If a  b  mod n  and b  c  mod n  then a  c  mod n  .

d) If a  b  mod n  and c  d  mod n  then a  c  b  d  mod n  and


ac  bd  mod n  .

e) If a  b  mod n  , then a  c  b  c  mod n  and ac  bc  mod n  .

f) If a  b  mod n  , then a k  b k  mod n  for any positive integer k.

Proof. a) a  a  mod n 

Since  a  a   0  0.n for any integer a

 n | a  a

 a  a  mod n 

b) a  b  mod n 

 n |  a  b

 a  b  k .n for some k
 b  a  (k )n

 n | b  a 

 b  a  mod n  .

c) Let a  b  mod n  and b  c  mod n  then a  c  mod n 

 n |  a  b  and n |  b  c 

 n |  a  b  b  c 

 n | a  c

Number Theory | 30
 a  c  mod n  .

Thus if a  b  mod n  and a  c  mod n  then a  c  mod n 

d) Suppose a  b  mod n  and c  d  mod n 

 n |  a  b  and n |  c  d 

 a  b  nr and c  d  ns for some integers r, s


Now,

 a  c  b  d   a  b  c  d 
 nr  ns

 nr  s .

Therefore, n |  a  c    b  d 

  a  c    b  d  mod n 

a  c  b  d  mod n  .

Now, ac  bd  ac  bc  bc  bd   a  b  c   c  d  b  nrc  bns

 ac  bd  n  rc  bs 

 n | ac  bd  ac  bd  mod n 

e) Suppose a  b  mod n  but c  c  mod n  always holds. Thus

a  c  b  c  mod n  .and also ac  bc(modn)

Also, a  b  mod n  but c  c  mod n  always holds.

Then by (iv) we have

ac  bc  mod n  .

f) Suppose a  b  mod n   n |  a  b  .

We know that if k is positive integer then

ak  bk   a  b   a k 1  ak 2b  ....  bk 1 

Since, n | a  b , we have

Number Theory | 31
n |  a  b   a k 1  a k 2b  ....  bk 1   ak  bk

Therefore, n | a k  bk  a k  b k  mod n  .

Ex. 1 Show that 41| 220  1 .

Solution. To prove this, it is enough to show that 220  1 mod 41 .

We know that 27  5  mod 41  214  25  mod 41 .

And 26  23  mod 41 .

Thus,

220  214 26  25.23  mod 41  220  1 mod 41 .

99
Ex.2. Find last two digits of the number 9 .
9
Solution. We know 9  1 mod10  , therefore 99   1  1  9  mod10  .

Next, 92  81  19  mod100   94  361  39  mod100   98  21 mod100  .

Further, 99  89(mod100) and 910  1(mod100) .


9
Thus 99  99 10 k  99  910 k  89  1(mod100) .
Therefore, 89 are the last two digits.
Ex.3 Find the remainder obtained upon dividing, 1 ! + 2! + 3! + ... + 100! by 12.
Solution. Since each of 4!,5!,,100! contain 4!  1  2  3  4  24 , 4! + …+ 100! is divisible
by 12 the remainder is 1! + 2! + 3! = 1 + 2 + 6 = 9.

 n
Theorem. If ca  cb  mod n  then a  b  mod  where d  gcd  c, n 
 d
n
Proof. Given d  gcd  c, n  then d|c and d|n, therefore is an integer.
d
Consider, ca  cb  mod n  , then c  a  b   nk for some integer k.

Now as d|c and d|n, there exist integer r and s such that gcd  r , s   1 and dr  c and ds  n

Thus dr  a  b   dsk  r  a  b   sk .

Since, r and s are relatively prime

r  a  b   sk  s |  a  b 

 a  b  mod s 
Number Theory | 32
 n
 a  b  mod  .
 d
Hence the result.

Corollary. If ca  cb  mod n  and gcd  c, n   1 then a  b  mod n 

Corollary. If ca  cb  mod p  and p | c , where p is a prime number, then a  b  mod p  .

Proof. Since p is a prime gcd  c, p   p or 1. However as p | c, gcd  c, p   1 and the result


follows.

Ex.4 Prove each of the following

a) If a  b  mod n  and m | n then a  b  mod m 

b) If a  b  mod n  and c  0 then ca  cb  mod cn 

a b n
c) If a  b  mod n  and the integers a, b, n are divisible by d  0 then   mod  .
d d d

Solution. a) Suppose a  b  mod n  , then there is an integer k such that a  b  kn , since


m | n there is an integer t such that n  mt . Thus a  b  ktm  b  (kt )m and hence,
a  b  mod m  .

b) Suppose a  b  mod n  , then there is an integer k such that a  b  kn . Thus we


have for c  0 ca  cb  ckn  cb  k (cn) . Therefore, ca  cb  mod cn  .

c) Suppose a  b  mod n  , then there is an integer k such that a  b  kn so that


a b n
  k , for any d  0 . Since each of the integers a, b, n are divisible by d  0 , each of
d d d
a b n a b n
the numbers , , are integers so   mod  .
d d d d d d

Ex. 4. Give an example to show that a 2  b 2  mod n  need not imply a  b  mod n 

Solution. 52  42  mod 9  but 4  5  mod 9 

Ex.5. If a  b  mod n  prove that gcd  a, n   gcd  b, n  .

Solution. Suppose a  b  mod n  , then there exist positive integer k such that a  b  kn .
Let d  gcd(a, n), d '  gcd(b, n) . Since d  gcd(a, n) , we have d | a and d | n , so that
d | a, d | kn  d | a  kn  b . Thus d | b and d | n . Therefore, d  d ' . Further, d '  gcd(b, n),
Number Theory | 33
we have d ' | b and d ' | n , so that d ' | b, d ' | kn  d ' | b  kn  a . Thus d ' | a and d ' | n .
Therefore, d '  d .Thus d  d ' .

Ex.6. Find the remainder when 250 is divided by 7.


Solution.We know,

23  1 mod 7 
16
 248   23   116  mod 7 

 2 48  1 mod 7 

 250  248 2  248 22  1 4  4  mod 7  .

Thus 250  4  mod 7  , that is, remainder when 250 is divided by 7is 4.

Ex.7 Find the remainder when 44444444 is divided by 9.


Solution. Note that 1111  123  9  4 , so that 1111  4(mod9) .

Then 4444  16(mod9)  4444  2(mod9) . Therefore 44444444  (2) 4444 (mod 9) or
44444444  24444 (mod 9) . Now 23  1(mod 9) implies 29  1(mod 9) .
123
Thus 21111  21239  4   29   24  (1)123  16  (1)  7  7  2(mod 9) .
4
Hence, 24444   21111   24  7(mod 9) .

Thus 44444444  2 4444  7(mod 9) . Therefore, the remainder is 7.

Ex.8. What is the remainder when the following sum is divided by 4?

15  25  35    1005 .
Solution.Observe that each of 25 , 45 , 65 , ,1005 is divisible by 4. Now what remains to be
examined is the sum 15  35  55    995 which contains 50 terms. This can be rearranged in
25 pairs as follows.

(15  35 )  (55  75 )    (975  995 ) .

Here each pair is of the form,


(2n  1)5  (2n  1)5  (2n  1  2n  1)  ( 2n  1)4  (2n  1)3 (2n  1)    (2n  1)(2n  1) 3  (2n  1) 4 
 (4n)  ( 2n  1)  (2n  1) (2n  1)    (2n  1)(2n  1)  (2n  1) 
4 3 3 4

Thus whole sum is divisible 4 and hence the remainder is zero.

Number Theory | 34
3.2 SPECIAL DIVISIBILITY TESTS
In this section we will see a mathematical formulation of divisibility tests.
Theorem.Given an integer b  1 , any positive integer N can be written uniquely in terms of
powers of b as N  amb m  am1b m1  am  2b m 2    a1b  a0 where the coefficients ak can
take on b different values 0,1, 2,, b  1 .

Proof. By division algorithm there exist integers q1 and a0 such that

N  q1b  a0 , 0  a0  b .

If q1  b , we can divide once more and write

q1  q2 b  a1 , 0  a1  b .

Substituting for q1 , we obtain

N  (q2b  a1 )b  a0  q2b 2  a1b  a0 , 0  a1 , a0  b .

Further,if q2  b , we can proceed to get

N  q3b3  a2b 2  a1b  a0 , 0  a2 , a1 , a0  b .

Since, N  q1  q2    0 is strictly decreasing sequences, this process should terminate in


finite number of steps to give us

N  ambm  am1b m1  am  2b m 2    a1b  a0 ,

where the coefficients ak can take on b different values 0,1, 2,, b  1 .

Uniqueness:
Suppose that, N has two distinct representations as follows

N  ambm  am1b m1  am 2b m 2    a1b  a0  cmb m  cm1b m 1  cm  2b m 2    c1b  c0

where, 0  ai  b for each i and 0  c j  b for each j . This can be written as

0  dm bm  dm 1bm1    d1b  d 0

where d k  ak  ck . Since the two representations are different there exist di  0 for some i
. Let k be the smallest subscript for which d k  0 . Then

0  dmbm  dm 1bm 1    dk 1b k 1  d k b k .

This gives us

dk  b(dmb m k 1    d k 1 ) .

Number Theory | 35
Thus we have b | d k . The inequalities 0  ak  b and 0  ck  b give us b  ak  ck  b or
| dk | b . Therefore, b cannot divide dk . Hence, we must have d k  0 , for all k. Thus ak = ck
for all k . Therefore, the representation is unique.
m
Theorem. Let P( x)   ck x k be a polynomial function of x with integral coefficients ck .
k 0

If a  b(mod n) , then P(a)  P(b)(mod n) .

Proof. Observe that a  b(mod n) implies a k  b k (mod n) for k  1, 2,, m . Hence,

ck a k  ck bk (mod n) for k  1, 2,, m . Therefore, we have


m m
k k
 c a   c b (mod n) .
k 0
k
k 0
k

That is P(a)  P(b)(mod n) .

Corollary. If a is a solution of P( x)  0(mod n) and a  b(mod n) , then b is also a solution.

Proof.Since a  b(mod n) , we have P(a)  P(b)(mod n) . Further, a is a solution of


P( x)  0(mod n) , we have P( a)  0(mod n) , therefore, P(b)  0(mod n) . Thus b is also a
solution of P( x)  0(mod n) .
This result can be used to develop tests of divisibility. Let us begin with test of divisibility by
9, in decimal system.

Theorem.Let N  am10m  am110m1  am 210m 2    a110  a0 be the decimal expansion of


the positive integer N , 0  ak  10 , and let S  a0  a1    am . Then 9 | N if and only if
9| S .

Proof. We know that 10  1(mod9) . Let P( x)  am xm  am1 x m1    a1 x  a0 . Then in


view of above theorem P(10)  P (1)(mod9) . Clearly,

P(10)  am10m  am 110m1  am 210m 2    a110  a0  N

and
P(1)  a0  a1    am  S .

Thus N  S (mod9) . Therefore, 9 | N if and only if 9 | S .

In view of this result, we have an integer N is divisible by 9 if and only if sum of digits in N
is divisible by 9.
Let us now proceed to divisibility by 11.

Number Theory | 36
Theorem.Let N  am10m  am110m1  am 210m 2    a110  a0 be the decimal expansion of
the positive integer N , 0  ak  10 , and let T  a0  a1  a2    (1)m am . Then 11| N if
and only if 11| T .

Proof. We know that 10  1(mod11) . Let P( x)  am xm  am1 x m1    a1 x  a0 . Then in


view of above theorem P(10)  P (1)(mod11) . Clearly,

P(10)  am10m  am 110m1  am 210m 2    a110  a0  N

and

P(1)  a0  a1    (1)m am  T .

Thus N  T (mod11) . Therefore, 11| N if and only if 11| T .

In view of this result, we have an integer N  am10m  am110m1  am 210m 2    a110  a0 is
divisible by 11 if and only if T  a0  a1  a2    (1)m am is divisible by 11.

Ex.9 Without performing the divisions, determine whether the integers 176,521,221 and
149,235,678 are divisible by 9 or 11?
Solution. a) Consider the integer 176,521,221. Observe that
i) 1+7+6+5+2+1+2+2+1=27, which is divisible by 9. Therefore, 176,521,221 is
divisible by 9.
ii) 1-7+6-5+2-1+2-2+1= - 3 , which is not divisible by 11. Therefore, 176,521,221 is
not divisible by 11.
b) Consider the integer 149,235,678. Observe that
i) 1+4+9+2+3+5+6+7+8=45 , which is divisible by 9. Therefore, 149,235,678 is
divisible by 9.
ii) 1-4+9-2+3-5+6-7+8= 11 , which is divisible by 11. Therefore, 149,235,678 is
divisible by 11.
Looking at the above results regarding divisibility, students are advised to develop
divisibility tests for other integers in decimal as well as other systems also. For example,
10  1(mod3) gives us divisibility test for divisibility by 3 in decimal system where as
9  0(mod3) gives us divisibility test for divisibility by 3 in the system to the base 9 and
9  1(mod8) gives us divisibility test for divisibility by 8 in the system to the base 9. Let
P( x)  am xm  am1 x m1    a1 x  a0 . Let N  am 9m  am1 9m1  am 2 9m 2    a1 9  a0
where 0  ak  9 be a number to the base 9. Then 9  0(mod3) implies
P(9)  P (0)(mod 3)  N  a0 (mod 3) . Therefore, 3 | N if and only if 3 | a0 . Similarly, we
can prove that 8 | N if and only if 8 | a0  a1    am .
Number Theory | 37
Ex.10 Test whether the integer (447836)9 is divisible by 3 and 8?

Solution. Consider (447836)9 . Here a0  6 and is divisible by 3. Therefore, (447836)9 is


divisible by 3. Now consider 4  4  7  8  3  6  32 which is divisible by 8. Hence,
(447836)9 is divisible by 8.

Exercises 3.1

1. Prove that the integer 53103  10353 is divisible by 39.

2. Use theory of congruence to verify that 89 | 244  1 and 97 | 2 48  1 .

3. For any integer a , prove that a 4  0(mod 5) or a 4  1(mod 5) .

4. Working with modulo 9 or 11m find the missing digit in the calculation below
a) 51840  273581  1418243 x 040

b) 2 x99561  [3(523  x)]2

(Ans. a) 9, b) 4)
3.3. Linear congruences:
Definition. An equation of the form ax  b(mod n) is called linear congruence.

An integer x0 is a solution of ax  b(mod n) if ax0  b(mod n) .

We begin with
Theorem. The linear congruence ax  b(mod n) has a solution if and only if d | b , where
d  gcd(a, n) . If d | b , then it has d mutually incongruent solutions modulo n .

Proof. Observe that ax  b(mod n) is equivalent to linear Diophantine equation ax  ny  b .


We know that ax  ny  b has a solution if and only if d | b . Moreover if it has a solution
n b
x0 , y0 then any other solution has the form x  x0  t , y  y0  t for some choice of
d d
integer t . Consider the following set of d solutions
n n (d  1)n
x0 , x0  , x0  2 ,, x0  .
d d d
We shall prove that these d solutions are mutually incongruent modulo n .
Suppose on the contrary that
n n
x0  t1  x0  t2 (mod n)
d d
where 0  t1  t2  d  1 , then

Number Theory | 38
n n
t1  t2 (mod n) .
d d

n  n n
Now gcd  , n   , and therefore, we can cancel to get
d  d d

t1  t2 (mod d ) .

which implies d | t1  t2 . Since 0  t1  t2  d  1 , d cannot divide t1  t2 . Thus we arrive at


contradiction.
n
Now it remains to prove that any other solution x0 
t is congruent modulo n to one of the
d
d integers listed above. By division algorithm, we have t  dq  r where q and r are
integers with 0  r  d . Hence,
n n n n
x0  t  x0  (qd  r )  x0  nq  r  x0  r (mod n) .
d d d d
This proves the result.
Corollary.If gcd(a, n)  1 , then the linear congruence ax  b(mod n) has a unique solution
modulo n .
This is immediate from the above theorem.
Ex.11.Solve 18 x  30(mod 42) .

Solution.Consider 18 x  30(mod 42) . Here, gcd(18,42)  6 and that 6 | 30 . Therefore, there


n
are 6 incongruent solutions modulo 42 given by x  x0  t (mod n) where x0 is a particular
d
solution of given linear congruence and t  0,1,,5 . Now
18x  30(mod 42)  3x  5(mod 7) multiplying both sides by 5, we obtain
15 x  25(mod 7)  x  4(mod 7) . Thus x0  4 is a particular solution.

Hence, the six solutions incongruent modulo 42. Thus the 6 solutions are
42
x  4  t (mod 42)  4  7t (mod 42) , that is, x  4,11,18, 25,32,39(mod 42) .
6
Ex.12 Using congruence solve 4x  51y  9 .

Solution.Consider 4x  51y  9 . This can be written as linear congruence 4 x  9(mod51) .


We now solve this linear congruence for x . Now consider 4 x  9(mod51) .

Multiplying both sides by 13, we get 52 x  117(mod51) , Thus x  52 x  117(mod51) .

Therefore, x  117  15(mod51) . Hence, x  15  51t where t is any integer.

Number Theory | 39
Next we can take
51y  9(mod 4)  3 y  1(mod 4)  9 y  3(mod 4)  y  3(mod 4)  y  3  4s,

where s is any integer. Using values of x and y in 4x  51y  9,

we obtain the relation between r and s given by 4(15  51t )  51(3  4s)  9  r  t  1  0.

In general x  15  51t and y  3  4(1  t )  1  4t , where t is any integer.

Note. Value of y in terms of t can also be obtained directly on putting value of x in terms
of t in the equation 4x  51y  9 .

Theorem. (Chinese Remainder Theorem)


Let n1 , n2 , , nr be positive integers such that gcd(ni , n j )  1 for i  j . Then the system of
linear congruences
x  a1 (mod n1 )
x  a2 (mod n2 )

x  ar (mod nr )

has a simultaneous solution, which is unique modulo the integer n1n2  nr .

n
Proof.Let n  n1n2  nr . For each k  1, 2,, r , let N k   n1n2  nk 1nk 1  nr . Since ni
nk
are relatively prime in pairs, gcd( N k , nk )  1 , for k  1, 2,, r . Hence, each of the linear
congruence N k x  1(mod nk ) has a unique solution say xk , for k  1, 2,, r . Thus Nk xk 
1(mod nk)
Let x  a1 N1 x1  a2 N 2 x2    ar N r xr .

Claim: x is simultaneous solution of the system.


Since nk | Ni for i  k , N i  0(mod nk ) for i  k .

Hence,
x  a1 N1 x1  a2 N 2 x2    ar N r xr  ak N k xk (mod nk ) .

Since N k xk  1(mod nk ) , we have x  ak 1  ak (mod nk ) ,for k  1, 2,, r .

This proves the existence of solution

Number Theory | 40
Uniqueness:
Let x ' be any other solution of the given system of linear congruences, then
x '  ak  mod nk  , for each k = 1, 2,..., r .

Hence x  x  mod nk  , (k = 1, 2, …, r)

 nk | x  x (k = 1, 2, …, r) .

Since gcd  ni , nk   1, for i  k , we have

n  n1 n 2 ...n r x - x 

 x  x  mod n  .
Hence the uniqueness.
Ex.12 The problem posed by Sun – Tsn corresponds to the system of three
congruences

x  2  mod3

x  3 mod5

x  2 mod7 .

Solution – Here n1  3, n2  5, n3  7 .

So n  nn
1 2n3  3.5.7 105

n 105
N1    35
n1 3

n 105
N2    21
n1 5

n 105
N3    15
n3 7
Consider,

N1x  1 mod3  35x  1 mod3

By inspection x1  2 is a solution of this linear congruence.


Next,

Number Theory | 41
N2 x  1 mod5  21x  1 mod5

By inspection x2 1 is a solution of this linear congruence.


Further,

N3 x  1 mod7 15x  1 mod7 

By inspection x3 1 of this linear congruence.


Consider,

x  a1N1x1  a2 N2 x2  a3 N3 x3
 2.35.2  3.21.1  2.15.1

x  233

Thus x  233 mod105 , that is, x  23 mod105 is simultaneous solution given
congruences.

Ex.13Solve 17 x  9  mod 276 .

Solution. Note that 276  3.4.23 and given linear congruence is equivalent to

17 x  9  mod3 or x  0 mod3 , (1)

17 x  9  mod 4  or x  1 mod 4 , (2)

17 x  9  mod 23 . (3)

Now

x  0  mod3  x  3k , for any integer k. (4)

Using this in the second, we get

3k  1 mod 4 or

k  9k  3  mod 4

 k  3  4 j , for any integer j. (5)

Thus, x  3k  3  3  4 j   9  12 j . (6)

Using this in (3), we obtain

17  9 12 j   9  mod 23

Number Theory | 42
 204 j  144  mod 23

 3 j  6  mod 23

 j  2  mod23

 j  2  23t , where ‘t’ is arbitrary integer.

Thus, x  9  12  2  23t   33  276t .

Hence, x  33  mod 276 is the solution.

Linear Congruence of Two Variables


Linear congruence of two variables is a congruence of the form

ax  by  c  mod n .

Theorem. The system of linear congruences ax  by  r  mod n and cx  dy  s  mod n has

a unique solution modulo n whenever gcd  ad  bc, n   1

Proof. Consider ax  by  r  mod n ……….. (1)

and cx  dy  s  mod n . …………(2)

1 d   2 b gives us


 ad  bc x   dr  bs  mod n . ………..(3)

Since gcd  ad  bc, n   1 ,

 ad  bc z  1 mod n ……….. (4)

has a unique solution of modulo n.


Let ‘t’ be a solution of (4) then

 ad  bc t  1 mod n ……….. (5)

Multiplying both sides of (3) by ‘t’ we obtain

 ad  bc xt   dr  bs  t  mod n …………(6)

Using (5) in (6) we get,

x   dr  bs  t  mod n .

Number Theory | 43
Similarly, 1  c   2  a gives us

 bc  ad  y   cr  as  mod n
  ad  bc  y   as  cr  mod n 

 y   as  cr  t  mod n

Ex.14 Solve 7 x  3 y  10  mod16 ….. (1)

2x  5 y  9  mod16 ….. (2)

Solution.Observe that gcd  7  5  3 2,16  gcd  35  6,16  gcd  29,16 1.

Hence, solution exists.

Consider,  ad  bc  z  1 mod n    7  5  3  2 z  1 mod16 that is, 29z  1 mod16

By inspection z  5 is a solution, therefore t  5 .

Therefore, x   dr  bs  t  mod n gives us

x  (5 10  3  9)(5)(mod16)  x  23  5(mod16)  x  115(mod16)  x  3(mod16)

Similarly, y  (7  9  2 10)(5)  43  5  215  7(mod16)

We can also solve this problem directly as follows.

1  5  2  3 gives us
35x 15 y  50  mod16

6 x  15 y  27  mod16

 29x  23 mod16

 13x  7  mod16 

 x  3 mod16

Next, 1  2  2  7 gives us


14x  6 y  20  mod16

14x  35 y  63 mod16

⇒ -29y ≡-43 (mod16)

Number Theory | 44
⇒ 29y ≡ 43 (mod16)
-3y ≡ -5 (mod16)
33y ≡ 55 (mod 16) (multiplying by 11 an brth sides)

 y  7  mod16

EXERCISES 3.2

1. Solve 25x  15  mod 29 (Ans. x  18(mod 29) )

2. Solve 140 x  133(mod301) (Ans. 16 + 63t, t = 0, 1, 2, ..., 6)

3. Using congruences, solve 12 x  25 y  331 . (Ans. x  13  25t ; y  7  12t )



Number Theory | 45
Unit-4
Fermat’s Theorem

4.1 Let us begin with Fermat’s theorem


Theorem. Let p be prime and a is an integer such that p ∤ a then

a p1  1 mod p  .

Proof. Consider the numbers a,2a,3a,,( p 1)a .

Claim. These  p  1 integers are incongruent modulo p.

Let if possible ra  sa  mod p

where 1  r  s  p .

Since p ∤ a and p is prime gcd  p, a  1 So, ra  sa  mod p

 r  s  mod p 

⇒ p | r − s.
Since, 1 ≤ r < s < p, p can not divide r  s .
Hence a, 2a, ..., (p-1) a leave different remainders when divided by p. Therefore, a, 2a, ...,
(p-1) a leave remainders 1, 2, ..., p-1 in some order.
Therefore,
a  2a  3a ( p  1)a  1 2  3( p  1)(mod p)

 1  2  3 ( p  1)a p 1  1 2  3 ( p  1)(mod p )

 ( p  1)!a p 1  ( p  1)!(mod p)

 a p1  1 mod p .

Note that as gcd (p, (p-1)!) = 1 we can cancel ( p  1)! from both sides.
p
Corollary. If p is prime, then a  a  mod p  for every integer a .

Proof. If p | a then the result is trivially true. Further if p ∤ a then by Fermat’s theorem

a p1  1 mod p 

 a p  a  mod p  .

Number Theory | 46
Ex. 1 Find the remainder when, 538 is divided by 11.
10 4
Solution.By Fermat’s Theorem 5  1 mod11 . Clearly 52  3(mod11) and 3  4  mod11
8 4
Thus, 5  3  4  mod11 .

Hence, 538  53058  (510 )3 58  13  4  4(mod11)

Therefore, 538  4  mod11 .

Thus remainder is 4.
Ex.2. Use Fermat’s theorem to verify that 17|11104 + 1.
Solution. By Fermat’s theorem

1116  1 mod17 .
6
 
Further 1116   16  mod17   1196  1116  16  1(mod17) .

Now

112  121  2  mod17   118  24  (1)(mod17) .

Thus

11104  1196.118  1 1 mod17   11104 1  0  mod17 .


n
Note. If a  a  mod n fails to hold good for some choice of a then n is necessarily
composite.

For example, n  117, then 2117  2167  5  (27 )16  25 .

Here 27  128  11 mod117  .

So that

2117  (27 )16  25  1116  25 (mod117) .

Now (11)16  (121)8  48 (mod117) .

Thus,

2117  48  25  221 (mod117) .

Now,
3
221   27   113 (mod117) .

Therefore,

Number Theory | 47
113  12111  4.11(mod117)

Thus

221  113  44(mod117) .

Hence,

(a1  q p 1  1(mod pq) .

Thus,

2117  44  mod117

2117  2  mod117 

and that 117=13x9 is composite.


Lemma. If p and q are distinct primes with ap ≡ a (modq) and aq ≡ a (modp) and then

a pq  a  mod pq  .

Proof – By Fermat’s theorem


(aq)p ≡ aq (mod p) and (ap)q ≡ ap (mod q)
These two along with

a q  a  mod p  and a p  a  mod q 

Gives us
(aq)p ≡ aq (mod p) ⇒ apq ≡ a (mod p)
And
(ap)q ≡ ap ≡ a (mod q)

 a pq  a  mod q 
pq
Since p and q are distinct primes gcd  p, q  1 and , hence, a  a  mod pq  .

Ex.3. Let p and q be distinct primes, prove that p q 1  q p 1  1(mod pq) .

Solution. By Fermat’s theorem p q 1  1(mod q ) and q p 1  1(mod p ) . Also p q 1  0(mod p )


and q p 1  0(mod q) . Thus p q 1  q p 1  1(mod p) and p q 1  q p 1  1(mod q) , therefore,
p q 1  q p 1  1(mod pq) .

Ex.4. Let p and q be distinct odd primes such that p  1| q  1 . If gcd(a, pq)  1 , prove that
a q 1  1(mod pq) .

Number Theory | 48
Solution. Since gcd(a, pq)  1 and p, q are relatively prime gcd(a, p)  1 and gcd(a, q)  1 .

By Fermat’s theorem a q 1  1(mod q) and a p 1  1(mod p ) .

Since p  1| q  1 , (a p 1  1) | (a q 1  1) .

Therefore, as p | a p 1  1 , we have p | a q 1  1 . Hence, a q 1  1(mod p ) .

Thus a q 1  1(mod pq) .

Ex.5. Find the units digit of 3100 by use of Fermat’s theorem.

Solution.Observe that by Fermat’s theorem 34  1(mod 5) and 34  1(mod 2) .

Since gcd(5, 2)  1 , we get 34  1(mod10) . Thus 38  (34 )2  12  1(mod10) .

Hence, 39  383  1  3  3(mod10) . Further, 3100  3  (39 )11  3  311  34  38  11  1(mod10) .

Thus units digit is 1.


4.2 Pseudo Prime
p 1
By Fermat’s theorem a  1 mod p  happens for all prims p with the condition that

p∤a
p 1
However a  1 mod p  may hold for non-prime p also.

Consider the example

210  1024  31 33  1 .


That is

210  1 mod31  211  2  mod31 .

And by Fermat’s theorem

210  1 mod11 .

So that

231  2  230  2  (210 )3  2  1(mod11) .

Therefore,

21131  2(mod11  31)

 2341  2  mod341

 2340  1 mod341

Number Theory | 49
n1
Thus a  1 mod n  holds for non-prime n. In other words, n | an1 1.

In particular n | 2n1 1 .
Such a composite integer ‘n’ is called Pseudo prime.
n1
Note. a  1 mod n  need not imply n is prime.

Definition.A composite number n is pseudo prime if n | 2n  2 .

Note. Smallest pseudo prime is 341. Some others are 561, 645, 1105.
n
Theorem. If n is an odd pseudo prime then Mn  2 1 is a larger one .

Proof. Let ‘n’ be an odd pseudo prime. Since n is composite, let n  rs, where r , s  1 we
may assume that 1  r  s  n . Then

Mn  2n 1

 2 rs  1
s
  2r   1

= (2r – 1) [(2r)s-1 + (2r)s-2 + .... + (2r) + 1]

Thus M n is composite number .


Since n is pseudo prime, n|2n – 2. .
That is, 2 n 1  2  kn for some integer k.
Now,
n
2 M n 1  1  2 2 2
1

 2kn  1
 (2 n  1)  ( 2 n )k 1  (2n ) k 2    1

 M n  ( 2 n ) k 1  (2n )k  2    (2n )  1 .

Thus ,

 
M n | 2Mn 1  1  M n | 2 2M n 1  1  2M n  2 .

Therefore, M n is pseudo prime.


n
Definition. (Pseudo Prime to base a). A composite integer n for which a  a  mod n
holds in called pseudo prime to the base a .

Number Theory | 50
Notes . 1. Pseudo prime to the base 2 is called pseudo prime.
2. 91 is smallest pseudo prime to the base 3.
3. 217 is the smallest pseudo prime to the base 5.
4. There are infinitely many pseudo primes to any given base
5. There are 245 pseudo prime less than one million.
6. First example of even pseudo prime is 161038 = 2x73x1103 and was found in
1950.
7. There exist composite number n which are pseudo prime to every base a i.e.
n
a  a  mod n for all 'a'. The least such integer is 561. These exceptional numbers are called
as absolute pseudo primes or Carmichael numbers .
Carmichael indicated four absolute pseudo primes namely 561, 1105, 2821, 15841.
Ex.6. Prove that 561 is an absolute pseudo prime.
Solution. Note that 561 = 3x11x17.

Let gcd  a,561  1then gcd  a,3  1 , gcd  a,11  1,gcd  a,17  1 .

Hence by Fermat’s theorem

a2  1 mod3 , a10  1 mod11 , a16  1 mod17

⇒ a560 ≡ (a2)280 ≡ 1280 ≡ 1 (mod3),


a560 ≡ (a10)56 ≡ 156 ≡ 1 (mod11),
a560 ≡ (a16)35 ≡ 135 ≡ 1 (mod17),

Thus, a 560  1(mod 3  11 17) .

That is, a560 ≡ 1 (mod 561) i.e., a561 ≡ a (mod 561).


Theorem. Let n a composite square free integer say, n  p1 p2  p where the pi are distinct
primes. If pi-1 | n-1 for i  1,2,, r then n is absolute pseudo prime.

Proof. Suppose a is an integer relatively prime to n, that is gcd  a, n   1.

Then gcd  a, pi   1 for i  1,2,, r .

Hence, by Fermat’s theorem, a pi 1  1(mod pi ) .

Thus pi | a pi 1  1 .

Since pi | n-1 for each i  1,2,, r , we have a pi 1  1| a n 1  1 .

Number Theory | 51
Thus pi | an-1 -1 for all i  1,2,, r .

Therefore, n  p1 p2  pn | a n1  1 .

Thus, an-1 ≡ 1(modn), for all integers a . (relative prime ton)


Hence n is absolute pseudo prime.
e. g. 1) 561 = 3 .11. 17
2|560, 10|560, 16|560
2) 1729 = 7. 13. 19
6|1728, 12|1728, 16|1728
3) 10585 = 5. 29. 73
4|10584, 28|10584, 72|10584
Note. 1) Therefore are only 43 absolute pseudo primes less than one million.
4.3 Wilson’s Theorem
Statement. For any prime p,( p  1)!  1(mod p) .

Proof. For p = 2, 3 the result is trivial


Let p > 3
Let a be any one of the integers 1, 2, 3, …, p – 1 .

Then gcd  a, p  1.

Consider the linear congruence ax  1 mod p  . Since gcd  a, p  1 the linear congruence

ax  1 mod p  has a unique solution modulo p.

Let a ' be a solution of ax  1 mod p  , such that a ' is one amongst 1, 2, …, p – 1 .

Thus a ' is unique integer such that 1 a  p 1 satisfying aa  1 mod p  .

Claim - : a  a if and only if either a  1 or a  p  1 .

Consider,

a2  1 mod p 

 a 2 1  0  mod p 

  a 1 a  1  0  mod p 

 a  1  0  mod p  or  a  1  0  mod p 

Number Theory | 52
Hence either a  1 or a  p  1 .

Thus for any a other than 1 and p – 1, a ' is distinct from a .

Thus we obtain ((p – 3)/2) pairs  a, a  such that, aa  1 mod p  .

Hence,
2  3( p  2)  1(mod p)

  p  2 !  1 mod p 

  p 1 p  2!  p 1 mod p 

  p 1 !  1 mod p 


e.g. Let p  13

2.7  1 mod13

3.9  1 mod13

4.10  1 mod13

5.8  1 mod13

6.11  1 mod13

Hence, 11!  1 mod13

i.e., 12!  1 mod13 .

Converse of Wilson’s theorem is also true

Theorem.If  n 1 !  1 mod n  then is prime.

Proof. Suppose n is composite then there is d such that 1< d < n and d|n. Then d |(n – 1) !
Thus d | 1 , so that we arrive at contradiction. Hence n is prime.
2
Theorem. The quadratic congruence x 1  0  mod p  where p is odd prime, has a solution

if and only if p  1 mod4 .


2 2
Proof. Let a be any solution of x 1  0  mod p  .Then a  1 mod p  .

Since p | a , Fermat’s theorem gives us

Number Theory | 53
p 1 p 1
1  a p 1   a 2  2   1 2  mod p  .

This holds only if p  1 is even.


2

i.e. p  1  0  mod 4 or p  1 mod4

(If p is of the form 4k + 3 then p  1 is of the form 2k + 1 and hence


2
p 1
2 k 1
 1 2   1  1.

So that, 1  1 mod p  which is impossible for odd prime)

Conversely,

Suppose that p  1 mod4


2
To prove that x 1  0  mod p  has a solution.

We know,

p 1  1 mod p 

p  2  2  mod p 

.
.
.

p 1  p 1
    mod p  .
2  2 
Consider,

 p  1  p  1 
( p  1)!  1  2    ( p  1)
 2  2 

 p 1   p  1 
 1  ( p  1)  2  ( p  2)    .
 2  2 
Thus we obtain,

p 1    p 1  
 p  1!  1 1 2  2  3  3 .....   
 2   2 

Number Theory | 54
2
 p 1   p  1  
  1 
 2 

 2  !  mod p  .
 
2
 p 1   p  1  
Since, p  1 mod 4  ,   is even and hence, ( p  1)!    ! (mod p ) .
 2   2  
By Wilson’s theorem, we have

 p 1!  1 mod p .


Thus,
2
 p  1  
1     !  mod p  .
 2  
2
 p 1  
That is,    !  1  0  mod p  .
 2  

 p 1 2
Therefore, x   ! is a solution of quadratic congruence x 1  0  mod p  .
 2 
Ex.7. Find the remainder when 15! is divided by 17 .

Solution. By Wilson’s theorem, we have 16!  1 mod17  , that is, 16!  16  mod17  .

Since gcd(16,17)  1 , we can cancel 16 from both sides and we get, 15!  1 mod17  .

Therefore, the remainder is 1.


Note. It may be noted that, for any prime p , ( p  2)!  1(mod p) which is an intermediate
step in the proof of Wilson’s theorem.
Ex.8 Find the remainder when 2.26!is divided by 29.
Solution.By Wilson’s theorem, 28!  1(mod 29) , that is , 1  28!(mod 29) . Therefore,

1  26!27.28 mod29

 1  26! 2 1 mod 29

 1  26! 2  mod 29 

 2.26!  28  mod 29  .

Number Theory | 55
4.4 Fermat’s Factorization Method
In this method we try to write integer n as difference of two squares. We start with an
integer a whose square is greater than n and nearest to n and proceed further by taking
a  1, a  2,..., a  k till we get an integer b such that (a  k ) 2  n  b 2 .
Ex.9 Using Fermat’s factorization method factorize 119143.
Solution. Observe that, 3452 < 119143 < 3462.
Consider,
3462 – 119143 = 119716 – 119143 = 573
3472 – 119143 = 120409 – 119143 = 1266
3482 – 119143 = 121104 – 119143 = 1961
3492 – 119143 = 121801 – 119143 = 2658
3502 – 119143 = 122501 – 119143 = 3357
3512 – 119143 = 123204 – 119143 = 4058
3522 – 119143 = 123902 – 119143 = 4761=(69)2.
Thus,
3522 – 119143 = (69)2 ⇒ 119143 = 3522 – (69)2

  352  69 352  69

 421 283 .
Ex.10. Factors 23449
Solution. Observe that 153 2  23449  154 2 .
Consider

154 2  23449  23716  23449  267


1552  23449  24025  23449  576  242 .

Thus

155 2  23449  24 2

23449  155 2  24 2

 155  24155  24

 179  131 .

Number Theory | 56
Note. While examinating the difference for possible square many values can be excluded by
inspection. We know that the square must end in one of the 6 digits 0, 1, 4, 5, 6, 9
Further by calculating the squares of the integers the last two digits are limited to 00,
01, 04, 09, 16, 21, 24, 25, 29, 36, 41, 44, 49, 56, 61, 69, 76, 81, 84, 89, 96.

Ex.11. Factorize 2279, 10541, 340663.


Solution. 1) 2279
We observe that-

47 2  2279  48 2 .
Consider,

48 2  2279  25  5 2 .

Therefore, 2279  48 2  5 2 .

2279   48  5  48  5 

= 53 × 43
2) 10541
We observe that

102 2  10541  103 2 .

Consider 103 2  10541  68


1024 – 10541 = 275

105 2  10541  484  22 2

105 2  10541  22 2

10541  105 2  22 2

 105  22105  22

= 83 × 127

3) 340663
We observe that
583 < 340663 < 590
Consider
(584)2 – 340663 = 393

Number Theory | 57
2
 585  340663  1562 ,
2
 586   340663  2733 ,
2
 587   340663  3906 ,
2
 588  340663  5081 ,
2
 589   340663  6258 ,
2
 590   340663  7439 ,
2
 591  340663  8618 ,
2
 592   340663  9801  99 2 .
2
Thus  592   340663  99 2 .

Hence,
2
340663   592   99 2

  592  99  592  99 

 493  691 .
4.5 Generalization of Fermat’s Factorization Method
Here we look for two integers x and y such that x2 – y2 is a multiple of n. In other
words x2 ≡ y2 (modn).
Let d = gcd (x – y, n) (or d = gcd (x + y, n)
Then is d a non – trivial divisor of n?, that is, do we have 1  d  n ?
In practice, n is usually the product of two primes p and q . Let n be a number of the form
n = pq, where p and q are prime integers. With no loss of generality we can take p < q.
Note that d is one of the integer 1, p, q, pq. Suppose that p | x  y and q | x  y then
pq | x  y . But then n  pq | x  y that is x  y  mod n  . Similarly if p | x  y and

q | x  y then x   y  mod n  . Since x   y (mod n) . Hence, one of p and q divides

 x  y and the other  x  y . Thus gcd  x  y, n and gcd  x  y, n give us the two divisors
of n.

Number Theory | 58
Ex.12. Factorize 2189.
Solution – Consider n = 2189.
Let us look for squares close to multiple of n.
Observe that 47 2  2189  20 .
Now 662  2  2189  22 ,
(81)2 − 3 × 2189 = −6 ,
(94)2 − 4 × 2189 = 80 ,
2
105   5  2189  80 ,
2
115   6  2189  91 ,
2
124   7  2189  53 ,
2
132   8  2189  88 ,
2
140   9  2189  101 ,
2
148   10  2189  14 ,
2
155   11  2189  54 .
2
Now, 81 155  12555  579  mod 2189  812  1552   579   mod 2189  .

Further
812   6  mod 2189 and 155 2   54  mod 2189 .

Thus (81)2 (155)2 ≡ (−6) (−54) ≡ (18)2 (mod 2189) .


2 2
Hence  579   18   mod 2189  .

Thus gcd(579  18, 2189)  gcd(597,2189)  199 and


gcd(579  18, 2189)  gcd(561,2189)  11 are factors of 2189.
EXERCISES
1. Factor the number 211  1 by Fermat’s factorization method.(Ans. 89x23)
2. Employ the generalized Fermat’s method to factor each of the following numbers
a) 2911 [Hint, 1382 ≡ 672 (mod 2911)]
b) 4573 [Hint, 1772 ≡ 922 (mod 2911)]


Number Theory | 59
Unit-5
Number Theoretic Functions

5.1 A function from set of integers into set of integers is called number theoretic function.
We begin with
Definition. For any integer n the number of positive divisors of n is denoted by  (n) .

Definition. For any integer n the sum of all positive divisors of n is denoted by  (n) .

e.g. 1. (1)  1, (2)  2, (3)  2, (4)  3, (5)  2, (6)  4, (7)  2, (8)  4, (9)  3, (10)  4

2.  (1)  1, (2)  3,  (3)  4,  (4)  7,  (5)  6,  (6)  12,  (7)  8,  (8)  15 ,

 (9)  13, (10)  18 .

Notation. Let n be any integer and d1 , d 2 , , d r denote divisors of n , then

 f (d )  f ( d )  f ( d )    f ( d ) .
d |n
1 2 r

With this notation we have  (n)  1;  ( n)   d .


d |n d |n

Note: For any prime p, ( p)  2,  ( p)  p  1 .

Theorem. If n  p1k1 p2 k2  pr kr is the prime factorization of n  1 , then the positive divisors


of n are precisely those integers d of the form d  p1a1 p2 a2  pr ar where 0  ai  ki
for i  1, 2,, r.

Proof. Note that the divisor d  1 is obtained when a1  a2    ar  0 and n itself occurs
when a1  k1 , a2  k 2 , , ar  kr . Let d be the nontrivial divisor of n , then n  dd '
where d , d '  1 . Let d  q1q2  qs , d '  t1t2  tu be the prime factorizations of d and
d ' . Then p1 1 p2 2  pr r  q1q2  qst1t2  tu will be two factorizations of n .
k k k

Hence, by uniqueness of factorization, we obtain d  p1a1 p2 a2  pr ar , where


0  ai  ki and the possibility that ai  0 is permitted.

Conversely, let d  p1a1 p2 a2  pr ar , where 0  ai  ki .

Then

n  p1k1 p2 k2  pr kr  p1a1 p2a2  pr ar p1k1  a1 p2k2  a2  pr kr ar  dd '

where d '  p1k1  a1 p2k2  a2  pr kr  ar and ki  ai  0 for 1  i  r . Then d '  0 and d | n .

Number Theory | 60
Theorem. If n  p1k1 p2 k2  pr kr is the prime factorization of n  1 , then

a)  (n)  (k1  1)(k2  1) (k r  1)

 p1k1 1  1   p2k2 1  1   prkr 1  1 


b)  ( n)      .
 p1  1   p2  1   pr  1 

Proof. We know that every divisor of n is of the form d  p1a1 p2 a2  pr ar where 0  ai  ki .


There are k1  1 choices for the exponent a1 , there are k2  1 choices for the exponent
a2 , … and k r  1 choices for the exponent ar . Hence,  (n)  (k1  1)(k2  1) (k r  1) .

Further,

 (n)  (1  p1  p12    p1k1 )(1  p2  p22    p2k2 ) (1  pr  pr2    prkr )

 p k1 1  1   p2k2 1  1   prkr 1  1 
Thus  ( n)   1    .
 p1  1   p2  1   pr  1 

e.g. Let n  180  22  32  51 .


Therefore,

 23  1   33  1   52  1 
 (180)  (2  1)(2  1)(1  1)  18 and  (180)       546 .
 2 1   3 1   5 1 

Theorem. The product of positive divisors of n  1 is nT(n)/2.


Proof.Let d and d ' be a positive divisors of n then n  dd  , where 1  d  n,1  d '  n .

So, n ( n)   d  d ' .Since  d   d ' .


d |n d '|n d |n d '|n

2  ( n)
We have , n ( n)    d   n 2
 d .
 d |n  d |n

e.g.  d  16 (16)/2  165/2  210  1024.


d |16

Note that ,  (20)   (5)  (4) but  (20)   (10)  (2) and  (20)   (5)   (4) but
 (20)   (10)   (2) .

5.2 Multiplicative Function


Let f be a number theoretic function, then f is multiplicative if,

f  mn
.   f  m  f  n whenever gcd  m, n  1.

Theorem.The function  and  are multiplicative.

Number Theory | 61
Proof : Let m, n be integers such that gcd  m, n  1. If either m = 1 or n = 1 then as

 1  1 and ,  (1)  1 ,the result is trivial.


Suppose that m > 1 and n > 1.
By fundamental theorem of Arithmetic

m  p1k1 p2k2  prkr and n  q1l1 q2l2  qsls .

where, p1 , p2 , , pr and q1 , q2 ,  , qs are primes and k1 , k 2 , , kr ; l1 , l2 , , ls are


positive integers.

Thus, mn  p1k1 p2k2  prkr q1l1 q2l2  qsls .

Since m and n are relatively prime, p1 , p2 , , pr and q1 , q2 ,  , qs are distinct


primes, we have

 p k1 1  1   p2k2 1  1   prkr 1  1   q1l1 1  1   q2l2 1  1   qsls 1  1 


 ( mn)   1           ( m) ( n)
 p1  1   p2  1   pr  1   q1  1   q2  1   qs  1 
and
 (mn)  (k1  1)(k2  1) (kr  1)(l1  1)(l2  1) (ls  1)   (m) (n)

Lemma. If gcd  m, n  1 then the set of positive divisors of mn consists of all products d 1 d 2

where d 1 | m and d 2 | n and gcd  d1, d2   1. Furthermore, these products are all
distinct.
Proof. Suppose m > 1 and n > 1, then, by Fundamental theorem of Arithmetic both m and n
have prime factorization as follows. m  p1k1 p2k2  prkr and n  q1l1 q2l2  qsls .

Then mn  p1k1 p2k2  prkr q1l1 q2l2  qsls and any divisor of mn is of the form
d  p1a1 p2a2  prar q1b1 q2b2  qsbs where 0  ai  ki and 0  bi  li .

Let d1  p1a1 p2a2  prar , d 2  q1b1 q2b2  qsbs . Hence, d1 | m and d 2 | n , d  d 1 d 2 ,


gcd   d1 , d2   1 and d 1 , d 2 are infact distinct.

Theorem. If f is a multiplicative function and F is defined by F  n   f  d  . Then F is


d |n

also multiplicative.
Proof. Let m, n be relatively prime integers.
Consider,

Number Theory | 62
F  mn    f  d    f  d1d 2  .
d |mn d1 |m
d 2 |n

Then F  mn    f  d1  f  d 2  .
d1 |m
d 2 |n

Since gcd  d1, d2   1 we can write

  
F  mn     f  d1    f  d2   .
 d1|m  d2 |n 

Thus F  mn   F  m F  n .

e.g. Let m = 8, n = 3, then


F(8.3) = f(1) + f(2) + f(3) + f(4) + f(6) + f(8) + f(12) + f(24)
= f(1.1) + f(2.1) + f(1.3) + f(4.1) + f(2.3) + f(8.1) + f(4.3) + f(8.3)
= f(1).(1) + f(2). f(1) + f(1).f(3) + f(4) . f(1)+ f(2) . f(3) + f(8) . f(1) + f(4) . f(3)
+ f(8) . f(3)
= (f(1) + f(2) + f(4) + f(8)) (f(1) + f(3)) = f(8) . f(3)
Corollary. The function  and  are multiplicative.

Proof. We know f (n)  1 and f (n)  n are multiplicative. Hence,  (n)  1 and
d |n

 (n)   d are multiplicative.


d |n

5.3 The Mobius inversion formula


We begin with
Definition.(Mobius  Function).

For a positive n, define the function  by the rules

1, if =1
( )= 0, if | for some prime p
(−1) if = ... where are all distinct

e.g.  1  1,   2  1,   3  1,   4  0,   5  1,

  6  1,   7  1,  8  0,   9  0,  10  1,

(30) = (2  3  5) = (-1)3 = -1.


Theorem. The function  is a multiplicative function.

Number Theory | 63
Proof. Let a, b be two relatively prime positive integers.

If p is a prime such that p 2 | a or p 2 | b , then   a   0 or   b  0 accordingly.

In this case p 2 | ab and hence,   ab    a .  b  0 .

Let both a and b be square free. Since a and b are relatively prime, there is no
common prime divisor.
Let a  p1 p2  pr and b  q1q2  qs where p1 , p2 , , pr ; q1 , q2 , , qs are all distinct.

Hence, ab is square free and ab  p1 p2  pr q1q2  qs .


r s r s
So,   ab    1   1  1    a .  b .

Hence, the result.


Theorem – For each positive integer n  1

1, if n  1
   d   0, if n  1
d |n 
where d runs through the positive divisors of n.

Proof – If n = 1, then    d    1  1. Suppose n  1 , then let F (n)    (d ) .


d |1 d |n

Let n  p k , for some prime p and k  1 , then

  (d )   (1)   ( p)   ( p )     ( p
d |n
2 K
)

 1   1  0  0  .....  0

 0.

Let n > 1, then there is prime factorization of n namely n  p1k1 p2 k2  pr kr , 1  k i , i  1, ...., r .

Since  is multiplicative, F (n)    (d ) is multiplicative.


d |n

Consider,

F (n)  F ( p1k1 p2k2  prkr )  F ( p1k1 ) F ( p2k2 ) F ( prkr )  0.

Since F ( p k )    ( d )  0 .
d | pk

Thus, we have    d   F  n   0 for n>1.


d |n

Number Theory | 64
Theorem. (Mobius Inversion Formula)
Let F and f be two number theoretic functions related by the formula

F  n   f  d  . Then
d |n

( )= ( ) = ( )
/ /

Proof. Note that, the two expressions

( ) and ( )
/ /

are infact one and the same as one can be obtained by replacing dummy index d by
n
d   ; as d ranges over all positive divisors of n.
d
Consider

n  
  (d )F  d      (d )  f c  

d |n d |n 
  c| n / d 

 
     ( d ) f (c )  . …… (1)

d | n  c|  n / d 


n n
Now, d | n and c |  da  n and cb  , for some integers a and b  c | n and
d d
n
d | .
c
Using this in Equation (1), we obtain

     
     ( d ) f ( c )      f (c )  ( d )     f ( c )   ( d ) 

d |n  c| n / d 
 c|n  d | n/ c   c|n  
    d | n / c  
We know that
n
   d   0, for all
n c
1
d|
c

= 1, n = c

Therefore,    d   1.
n
d|
c

Number Theory | 65
 
Hence, we obtain   f (c)   (d )    f (c) 1  f (n).
c|n   
d | n/ c  cn

n n
Hence, f  n      d F        F  d 
d |n  d  d |n  d 

Note. We know  (n)  1,  ( n)   d .


d |n d |n

n n
Hence, 1      ( d ) and n      ( d ) .
d |n d  d |n d 

Theorem. If F is a multiplicative function and F  n   f  d  . Then f is also multiplicative.


d |n

Proof. Let m, n be relatively prime positive integers.


We know that any divisor d of mn is of the form d  d 1 d 2 , where d 1 | m , d 2 | n and
gcd  d1, d2   1.

Invoking inversion formula, we have

 mn 
f ( mn)    (d ) F 
d |mn d 

 mn 
   (d d ) F  d d
1 2 
d1 |m ,
d2 |n
 1 2

m  n 
   (d )  (d ) F  d
1 2 F  
d1 |m ,
d 2 |n
 1   d2 

m  n 
   ( d1 ) F      ( d 2 )F  
d1 |m  d1  d2 |n  d2 
 f (m) f (n)

Thus f is multiplicative.

Ex. For each positive integer n, show that   n    n  1   n  2    n  3  0 .

Sol. Observe that one of the four consecutive integers n, (n + 1), (n + 2), (n + 3) is always
divisible by 4 = 22 and hence, not square free. Thus one of   n  ,   n  1 ,   n  2  ,   n  3
is always zero.

Number Theory | 66
5.4 Greatest Integer Function

For any real number x , the greatest integer function denoted by  x is defined as the

largest integer less than or equal to x , that is,  x is the unique integer satisfying

x 1   x  x .

Note that any real number x can be written as, x   x   , where 0    1 .


Moreover, [ x]  x if and only if x is an integer.

Theorem. If n is a positive integer and p is a prime, then the exponent of the highest power

n  n 
of p that divides n ! is   k  where the series is finite since  k   0 for p k  n.
k 1  p  p 
Proof. Among the first n integers those divisible by prime p are p, 2p, 3p, …,tp where t is the
greatest integer such that tp  n . In other words t is the largest integer less than or
n   n 
equal to , so that  t     .
p   p

n n
Thus there are   multiplies of p occurring in n!, namely, p, 2 p,  ,   p .
 p  p

Further, among the first n integers those divisible by p 2 are p 2 , 2 p 2 ,  , tp 2 ,

n
where, t is the largest positive integer such that tp 2  n , that is, t   2  .
p 

n n 
Thus there are  2  multiplies of p 2 occurring in n!, namely, p 2 , 2 p 2 , ,  2  p 2 .
p  p 
n
Similarly, those integers which are divisible by p 3 are precisely  3  in number and
p 
so on.
Observe that highest power of p that divides n is the sum of these integers namely,

n  n   n 

 p   p2   .....    k .
k 1  p 
   
  n 
 k 1  p k 
Note. In view of this result, we can write n !   p .
p n

Ex.1.Determine the number of zeros with which the decimal representation of 50! terminates.

Number Theory | 67
Solution. To determine the number of zeros, it is enough to observe how may tens divide
50!.
That is, how many pairs of 5 and 2 divide50!.
For that we are to find the exponents of 2’s and 5’s that divide 50!.

 50 
The exponent of 2    k 
k 1  2 

 50   50   50   50   50 
  2  3  4  5 
 2  2   2  2   2 
 25  12  6  3  1
 47 .
And,

 50 
Exponent of 5   k 
k 1  5 

 50   50 
  2 
 5  5 
 10  2
12.
Thus there are 12 pairs and hence 12 zeros.
Theorem. If n and r are positive integer with 1  r  n then the binomial coefficient

n n!
 r   n  r !r ! is also an integer .
   
Proof. We know that for any two real numbers a and b

 a  b   a    b  .
Using this we can write

 n  n  r   r 
 pk    pk    pk 
     
where p is a prime and k is a positive integer.

 n  n  r   r 
Thus  p k 
  k  k  . ……… (1)
k 1   k 1  p  k 1  p 

Number Theory | 68
Thus L.H.S. of Equation (1) is the exponent of highest power of p that divides n! and R.H.S.
of (1) is the highest power of p that divides  n  r ! plus highest power of p that divides r!.

Thus r.h.s of (1) is the highest power of p that divides the product  n  r  !r ! .

Thus highest power of p that divides  n  r  !r ! is less than or equal to highest power of p
that divides n!.
n!
Hence, is always an integer.
 n  r  !r !

Corollary. For a positive integer r the product of any r consecutive positive integer is
divisible by r!
Proof. Let n be a positive integer such that n, n – 1, n – 2, ….., n – (r – 1) are r consecutive
positive integers.
Consider,
( − 1) … ( − + 1)( − ) … 2.1
( − 1) … ( − + 1) =
( − ) … 2.1
n!

 n  r !
n!
  r!
 n  r ! r !
n!
Since, is an integer, the product of r consecutive positive integer is divisible by r!.
 n  r  !r !
e.g. n  n  1 n  2 n  3 are divisible by 4!.

Theorem. Let f and F be number theoretic functions such that F  n   f  d  .


d |n

Then for any positive integer N,


N N
N 
 F  n    f  k   k  .
n1 n1

Proof. We have F  n   f  d  .
d |n

N N
Therefore,  F  n   f  d  .
n 1 n 1 d |n

Number Theory | 69
The strategy is to collect terms with equal values of f(d) in the double sum.

Let k  n be fixed, then f(k) appears in  f d 


d |n
if and only if k divides n.

Since each integer divides itself, f(k) appears in the sum at least once for each k,
1  k  n . Now in order to find the number of sums  f  d  in which f(k) occurs, it
d |n

is enough to find the number of integers amongst the numbers 1,2,3,…,N which are
N N 
divisible by k. These are exactly   of them; k , 2k ,,   k . Thus for each k
k  k
N 
such that 1  k  N , f (k ) is a term of the sum  f (d )
d |n
for   different positive
k 
N N
N 
integers less than or equal to N . Thus  f (d )   f (k )  k  .
n 1 d |n k 1

e.g., Let us consider N = 10.


10

 f (d )   f (d )   f (d )     f (d )
n 1 d |n d |1 d |2 d |10

 f (1)
  f (1)  f (2) 
  f (1)  f (3) 
( f (1)  f (2)  f (4))
( f (1)  f (5))
( f (1)  f (2)  f (3)  f (6))
( f (1)  f (7))
( f (1)  f (2)  f (4)  f (8))
( f (1)  f (3)  f (9))
  f (1)  f (2)  f (5)  f (10) 

 f (1)(10)  f (2)(5)  f (3)(3)  f (4)(2)  f (5)(2)


 f (6)(1)  f (7)(1)  f (8)(1)  f (9)(1)  f (10)(1)

10  10  10  10  10 


 f (1)    f (2)    f (3)    f (4)    f (5)  
1 2 3 4 5

10  10  10  10  10 


 f (6)    f (7)    f (8)    f (9)    f (10)  
6 7 8 9 10 
N N
N 
Thus  F  n    f  k   K  .
n1 k 1

Number Theory | 70
N N
N 
Corollary. If N is a positive integer then    n     
n1 k 1  k 

Proof . We know   n   1 . Thus by taking  for F and f to be the constant function


d |n

f (n)  1 for all n , we obtain


N N
N N N
   n    1.      k  .
n1 k 1  k  k 1

Similarly, we obtain
N N
N
Corollary. If N is a positive integer then    n    k  .
n1 k 1  k 

e.g. Consider the case N = 6


N 6
6 6 6 6 6 6 6
       =                 
n 
n1 k 1  k   1   2   3   4   5   6 

 6  3  2 1 11
14
And
6 6
6
   n    k.  
n 1 k 1 k 
 1 6   2  3  3  2  4 1  5 1  6 1
 33.
Exercises
1. Find the highest power of 5 dividing 1000! And highest power of 7 that divides 2000!
2. Determine the number of zeros with which the decimal representation of 1000!
terminates.
3. For what value of n does n! terminates in 37 zeros?
Answers: 1. 249,164 2. 249 3.150.


Number Theory | 71
Unit-6
Euler’s Generalization of Fermat’s theorem

6.1 We begin with


Definition – (Euler phi function)

For n  1, let   n  denote the number of positive integers less than or equal to n and
relatively prime to n.

e.g.,  1  1,   2  1,   3  2,   4  2,  5  4,  6  2,   7  6,

  8  4,  9  6, 10  4,  30  8 .

Note. For any prime p,   p   p 1 .

 1
Theorem. If p is a prime and k  0 then   p k   p k  p k 1  p k  1   .
 p

Proof. Since gcd(n, p k )  1 if and only if p | n . Amongst the integers 1, 2, ..., pk those
divisible by p are p, 2p, 3p, ..., (pk-1) p. Thus the number of positive integers less than or
equal to pk that are divisible by p are pk-1 .
Therefore, number of positive integers less than pk that are relatively prime to pk is

 1
  p k   p k  p k 1  p k  1   .
 p

Lemma. Given integers a, b, c,gcd  a, bc   1 if and only if gcd  a, b   1 and gcd  a, c   1

Proof. Suppose gcd  a, bc   1 .Let d  gcd( a , b ) , then d | a and d | b , so that d | a, d | bc

and hence, d  gcd  a, bc  1 . Therefore d = 1 .Similarly gcd  a, c   1 .

Conversely, suppose that gcd  a, c   1 .

Let d1 = gcd (a,bc). Let if possible d1  1 it must have prime factor p. Since p is prime,
d1 | bc  p | bc  p | b or p | c . Suppose p|b. Further, p | d1 and d1 | a  p | a consequently,
p  gcd(a, b) which is absurd. On the other hand if we take p|c, then p  gcd(a, c) is also a
contradiction.

Hence, gcd  a, bc   1 .

Theorem. The function  is a multiplicative function.

Number Theory | 72
Proof. Let m, n are relatively prime integers. Since  1  1 the result holds trivially when
either m = 1 or n = 1. Let m > 1 and n > 1.
Let us arrange m, n integers form 1 to mn as follows
1 2 … r … m
m+1 m +2 … m+r … 2m
2m + 1 2m + 2 … 2m + r … 3m
(n – 1)m + 1 (n – 1) m + 2 … (n – 1)m + r … nm.

Now,   mn  is equal to the number of entries in the array which are relatively prime to mn.

We know that a number is relatively prime to mn if and only if it is relatively prime to both m
and n. We know that, gcd  qm  r, m  gcd  m, r  , that is, if an element in the first row is
relatively prime to m, then the whole column corresponding to that element is relatively
prime to m. Therefore as many as  (m) columns are there each integer of which is relatively
prime to m.
Consider the entries in the rth column
r, m + r, 2m + r, … , (n – 1)m + r.
Let r be such that gcd(m, r )  1 .

Since,

km  r  jm  r  mod n  ,  0  j  k  n

 km  jm  mod n 

 k  j  mod n

 n|k  j.

which is absurd, no two entries in the rth column are congruent to one another modulo n.
Therefore, r , m  r , 2m  r ,,(n 1)m  r are congruent to 0, 1, 2, … , n – 1 modulo n in some
order.
Thus the rth column contains exactly as many integers relatively prime to n as the number
of integers 0, 1, 2, …., n – 1 which are relatively prime to n. Thus there are exactly  (n)
integers in the rth column that are relatively prime to n. Therefore, each of the   m columns

contain   n  integers which are relatively prime to n. Hence, there are  ( m) (n) integers
which are relatively prime to both m and n
Hence,  ( mn)   (m) (n) .Thus,  is multiplicative function.

Number Theory | 73
Theorem. If the integer n  1 has the prime factorization n  p1k1 p2k2  prkr , then

  n    p1k1  p1k1 1  p2 k2  p2 k2 1  ......  pr kr  pr kr 1 

 1  1   1 
 n 1   1   .......  1  .
 p1   p2   pr 

k
Proof. We shall prove this theorem by induction on r. For r  1, we have n  p1 1 and

 1   1 
  n     p1k1   p1k  p1k 1  p1k  1 
1 1 1
  n 1   .
 p1   p1 

Let the result hold for r = s.


Consider,

n  p1k1 ...... psks ps1ks1 .

Since gcd( p1k1 p2k2  psks , psks11 )  1 , we can write

  n     p1k1 ...... ps ks ps 1ks1 

  
  p1k1 ...... ps ks  ps 1ks1  (Since  is multiplicative)


  p1k1  p1k1 1  ...... ps ks  ps ks 1  p s 1
k s 1

 ps 1ks1 1 .

Hence, the result holds for r  s  1 whenever it holds for r = s. Therefore by principle of
induction the result holds for any r.
e.g. Let n = 360 then n  2 3 3 2.5 , so that

 1  1  1 
  360  360 1  1  1    96 .
 2  3  5 

Theorem. For n  2,  n  is an even integer .

Proof. Suppose n is a power of 2. Let n = 2k , for some positive integer k  1 .

 1
Then,   n     2k   2k 1    2k 1 which is even.
 2
Suppose n is not power of 2 an odd integer. Then there is an odd prime p that divides n.

Let n = pk.m where p ∤ m and k  1 . Since p | m,gcd  p k , m   1 and as  is multiplicative

 (n)   ( p k m)   ( p k ) (m)  p k 1 ( p  1) (m) .

Number Theory | 74
Since p is odd prime, p – 1 is even,so   n  is even.

6.2 Euler’s Theorem

Lemma – Let n  1 and gcd  a, n   1.If a1 , a2 ,, a ( n) are positive integers less than n and
relatively prime to n, then aa1 , aa2 ,, aa (n ) are congruent modulo n to a1 , a2 ,, a ( n) in
some order.
Proof.Claim : No two integers aa1, aa2, ..., aa(n) are congruent modulo n.

Let if possible aai  aa j  mod n , 1  i  j   (n) , then as gcd  a, n   1, we have

ai  a j  mod n   n | ai  aj

which is absurd.

Now, gcd  ai , n  1and gcd  a, n   1, 1  i   (n) implies that gcd  aai , n  1 for each
i  1,2,, (n) . Thus for any fixed 1  i   (n) , aai is congruent modulo n to unique
integer b , 1  b  n . Hence, gcd  b, n   gcd  aai , n  1 . Therefore, b must be one of
a1 , a2 ,, a ( n) .

Theorem (Euler’s Theorem). Let n  1 and gcd  a, n   1, then a    1 mod n  .


 n

Proof. Without loss of generality we can take n > 1. Let a1 , a2 ,, a ( n) be the positive

integers less than n and relatively prime to n. Then as gcd  a, n   1 , aa1 , aa2 ,, aa (n ) are
congruent to a1 , a2 ,, a ( n) in some order .

Let a '1 , a '2 ,, a ' ( n) be a rearrangement of a1 , a2 ,, a ( n) such that

aa1  a '1 (mod n)

aa2  a '2 (mod n)



aa ( n )  a ' ( n ) (mod n)

 
Thus,  aa1  aa2   aa ( n)  a '1 a '2  a ' ( n ) (mod n), that is, (aa1 )...(aa ( n) )

 a1a2  a ( n ) (mod n) .

Therefore, a ( n ) a1a2  a ( n )  a1a2  a ( n ) (mod n ) .

Since each a i is relatively prime to n for i  1,2,,  (n), we can write

Number Theory | 75
  n
a  1 mod n  .

Note. Note that, Euler’s theorem is Euler’s generalization of Fermat’s theorem.

Corollary. If p is a prime and p | a , then a p 1  1(mod p ) .

Ex.1 Find last two digits in the decimal representation of 3 2 56 .

Solution. We have to find smallest positive integer to which 3256 is congruent modulo 100.

 1  1 
Note that gcd  3,100  1and  (100)  100 1  1    40. so that by Euler’s theorem
 2  5 
3
 100
 1 mod100 that is, 340  1(mod100) .
6
Thus, 3 240   3 40   1  mod 100  .

4 8
Now, 3  81   19  mod100  38   3 4     19 2  mod100   3   39 mod100 .
2

2
Thus 316   39   21  mod100  .

Therefore, 3256  3240  316  1 21(mod100) .

Hence, the last two digits in the decimal representation of 3 2 56 are 21.

Ex.2.Using Euler’s theorem, prove that , for any integer a , a 37  a (mod1729) .

Solution. Observe that 1729  7 13  19 . Let a be an integer such that, gcd(a,1729)  1 ,then

gcd(a,7)  1,gcd(a,13)  1,gcd(a,19)  1 and so

a 6  1(mod 7), a12  1(mod13), a18  1(mod19) .

Thus, alcm (6,12,18)  1(mod 7 13 19)  a 36  1(mod1729)  a 37  a (mod1729) .

However, if 1729 | a , there is nothing to prove.

Ex.3. If m and n are relatively prime positive integers, then m (n) + n (m) 1 (modmn)
q1 p1
Hence deduce, p  q  1 mod pq  where p and q are distinct primes.

Solution. Since gcd  m, n  1 we have m    1 mod m  and n    1 mod n  also


 n  m

m ( n )  0(mod m); n ( m )  0(mod n) .


n   m   n   m
Thus, m n  1 mod n  and m n  1 mod m  .
  n   m
Hence, m n  1 mod mn  .

For distinct primes p and q we have

Number Theory | 76
 q   p
p q  1 mod pq  .
q1 p1
That is, p  q  1 mod pq  .

Exercises
1. Use Euler’s theorem to establish the following

a) For any integer a , a13  a (mod 2730)

b) For any integer a , a33  a (mod 4080) .

2. Find the unit’s digit of 3100 using Euler’s theorem.(Ans. 1)


6.3 Some properties of the Phi – function :
Theorem. (Gauss) For each positive integer n  1 , n    (d )
d |n

The sum being extended over all positive divisors of n.


Proof. The integers between 1 and n can be separated into classes as follows:

If d is a divisor of n we put the integer m in the class Sd provided gcd  m, n   d .

In symbols, S d  m : gcd( m, n )  d ;1  m  n .

m n
Since gcd  m, n   d , we have, gcd  ,  1.
d d

n
Therefore, number of positive integers in Sd is precisely   .
d 
Further, each integer between 1 and n belongs to precisely one Sd .

Therefore,

n
n   Sd      .
d |n d |n d 
But as ‘d’ runs over all the positive divisors of n, so does n/d, hence,we can write

n    d  .
d |n

e.g. Let n=10, the integers relatively prime to 10 are 1,3,7,9 and divisors of 10 are 1,2,5,10.
Consider
S1  {1, 3, 7,9}, S 2  {2, 4, 6,8}, S5  {5}, S10  {10} and  (10)  4,  (5)  4,  (2)  1,  (1)  1 .
Observe that  (10)   (10 / 1) | S1 | 4,  (5)   (10 / 2) | S2 | 4,  (2)   (10 / 5) | S5 | 1,

Number Theory | 77
 (1)   (10 / 10) | S10 | 1 . Therefore,

 (d )   (1)   (2)   (5)   (10)  1  1  4  4  10.


d |10

Lemma. For integers a, n, gcd(a, n) = 1 if and only of gcd  n  a, n   1 .

Proof. Suppose gcd  a, n   1 , and d  gcd  n  a, n   d | n  a, d | n , hence,


d n, d n   n  a   a  d  gcd  a, n   1  d  1 . That is, gcd  n  a, n   1 . On the other
hand, suppose gcd  n  a, n   1 and d  gcd  a, n  , then
d a, d n  d n  a, d n  d  gcd  n  a, n   1  d  1 . Thus gcd  a, n   1 .

Let us fix n = 15, then the integers relatively prime to 15 are 1, 2, 4, 7, 8, 11, 13, 14.
Then 15  1  14,15  2  13,15  4  11,15  7  8,15  8  7,15  11  4,15  13  2,15  14  1
are also relatively prime to 15 and is indeed a rearrangement of all integers relatively to 15.
Thus we can write
1  2  4  7  8  11  13  14 
15  1  15  2   15  4   15  7   15  8   15  11  15  13  15  14 
Thus

1  2  4  7  8  11  13  14  8 15  1  2  4  7  8  11  13  14 
That is

2 1  2  4  7  8  11  13  14   8  15,

Or

 15 15
1  2  4  7  8  11  13  14  .
2
Thus, we have
Theorem. For n  1 , the sum of the positive integers less than n and relatively prime to n
1
is n (n) .
2
Proof. Let a1 , a2 ,, a ( n) be the positive integers less than n and relatively prime to n .
Since, gcd(a, n)  1 if and only if gcd(a  n, n)  1 , the numbers n  a1 , n  a2 , , n  a ( n) are
equal in some order to a1 , a2 ,, a ( n) . Thus

a1  a2    a ( n )  (n  a1 )  (n  a2 )    (n  a ( n ) )

 n (n)  (a1  a2    a ( n ) ) .

Number Theory | 78
 
Hence, 2 a1  a    a ( n)  n (n) and the result follows.

 (d )
Theorem.For any integer n  (n)  n .
d |n d

Proof. We know

F ( n)  n    ( d ) .
d |n

By inversion formula, we obtain

n
  n      d F  
d |n d

n
   d 
d |n d

 d 
 n
d |n d

 d 
 n .
d |n d

Let us illustrate this for n = 10,

 d     2    5   10  
10   10   1    
d |n d  2 5 10 

  1  1  1 2 


 10 1    
 2 5 10 

 1 1 1
 10 1    
 2 5 10 
2
 10  4   10  .
5


Number Theory | 79
Unit-7
Primitive Roots and Indices

7.1 Let us begin with the definition of order of an integer modulo n.

Definition. Let n  1 and a be an integer such that gcd  a, n   1. Then the smallest positive
k
integer k such that a  1 mod n  is called order of a modulo n.

e.g. – 1) Let a  2 and n  5 . Here 24  1(mod 5) , then order of 2 modulo 5 is 4.

2) Let a  3 and n  5 . Here 34  1(mod 5) , then order of 3 modulo 5 is 4.

3) Let a  2 and n  7 . Here 23  1(mod 7) , then order of 2 modulo 7 is 2.

Notes. 1. If a  b  mod n then order of a modulo n is same as order of b modulo n.

2. If gcd  a, n   1 then ax  1 mod n has no solution. Then we can not talk about
order a modulo n. Therefore, whenever we talk order of a modulo n it is assumed that

gcd  a, n   1.

Theorem – Let the integer a have order k modulo n, then ah  1(modn) if and only if k | h in
particular k |   n  .
h
Proof. Let h be any positive integer such that a  1 mod n  .
k
Since k is order of a modulo n we have a  1 mod n  .

By division algorithm there exist integers q and r such that h  kq  r where 0  r  k .


q q
Hence, a h  a qk  r   a k  a r  1 a r  a r (mod n) . Thus a r  a h (mod n) this together with

ah  1 mod n  gives us a r  1(mod n) .If 0  r  k , minimality of k is contradicted. Hence,


r  0 . Thus h = kq or k | h.
Conversely, if k | h then there is an integer q such that kq  h and
q
a k  1(mod n)   a k   1q (mod n)  a h  a kq  1(mod n).

  n
Since a  1 mod n  by Euler’s theorem, we have, k |   n  .
i j
Theorem. If the integer a has order k modulo n then a  a  mod n  iff i  j  mod k  .

Number Theory | 80
i j
Proof. With no loss of generality we can take i > j Since a  a  mod n  and gcd  a, n   1
i j
we have, a  1 mod n  .

Since a has order k modulo n, k | i  j i.e. i  j (mod k ) .

Conversely, if i  j (mod k ) then k | i  j therefore i  j  kq for some integer q. Then,


q
ai  a j  qk  a j  a k   a j 1(mod n)  a  a  mod n  .
i j

i j
Thus, a  a  mod n  .

Corollary. If a has order k modulo n then integers a, a 2 ,  , a k are incongruent modulo n.


i j
Proof. Let if possible a  a  mod n  with 1  j  i  k then i  j (mod k ) , that is, k | i  j
which is absurd.

Theorem. If the integer a has order k modulo n and h>0 then a h has order k / gcd  h, k 
modulo n.

Proof. Let d  gcd  h, k  then d|h and d|k . Therefore, there exist integers h1 and k1 such that

dh1  h and dk 1  k with gcd  h1, k1   1 .

h k1 h1
Consider, a   a hk1  a ( h1d )( k / d )  a h1k   a k   1h1  1(mod n) .

Thus, if r is the order a h modulo n, then r | k1 .

On the other hand we have,


ahr = (ah)r  1 (mod n)
r
a 
h
 a hr  1  mod n  .

Since the integer a has order k modulo n, a k  1(mod n) . Therefore, we have k | hr .

Hence, k | hr  k 1 d | d h1 r  k 1 | h1 r .Since gcd  h1, k1   1 by Euclid’s lemma k1 | r .

Thus k 1 | r Therefore, r  k1  k / d  k / gcd(h, k ) .

Corollary. Let a have order k modulo n. Then a h also has order k if and only if
gcd  h, k   1.

Definition (Primitive Root). Let n > 1 and a be an integer such that gcd  a, n   1 Then a

is primitive root of n if order of a modulo n is   n  .

e.g. 1) 2 and 3 are primitive roots of 5


Number Theory | 81
2) 3 and 5 are primitive root of 7.
Let us consider n = 7
Integer 1 2 3 4 5 6
Order 1 3 6 3 6 2

Now for n = 11
Integer 1 2 3 4 5 6 7 8 9 10
Order 1 10 5 5 5 10 10 10 5 2

Looking at the table, 3, 6 are primitive roots of 7 and 2, 6, 7, 8 are primitive roots of 11.
n
Ex.1 Show that if Fn  2 2  1,  n  1 is a prime then 2 is not a primitive root of Fn .

Solution. Consider
2
n1
22  1  2 2   n
1

 n
 22  1 22 1  n



 Fn 22 1
n


n 1
 22  1  mod Fn 

Thus order of 2 modulo Fn can not exceed 2 n+1. Since Fn is prime


n
  Fn   Fn  1  22
n
Since 2n1  22 , 2 is not a primitive root of n.

Theorem. Let gcd  a, n   1 and let a1 , a2 ,, a ( n) be the positive integers less than n and
relatively prime to n. If a is a primitive root of n, then a, a2,..., a(n) are congruent modulo n
to a1, a2,..., a(n) in some order.

Proof. Since gcd(a, n)  1 , a, a 2 , , a ( n ) are relatively prime to n. It remains to show that


a, a 2 , , a ( n ) are incongruent modulo n.
i j
Let if possible, a  a  mod n  ,  i  j(mod (n))

where 1  j  i    n  then   n  | i  j , which is impossible.

Number Theory | 82
Now for fixed k ,1  k    n  , there is a positive integer r , r  n such that a k  r (mod n)
and

gcd  a k , n   gcd  r , n   1 . So that r is positive integer less than n, relatively prime to n.


Hence r must be one of a1 , a2 ,, a ( n) . Since a1 , a2 ,, a ( n) are incongruent modulo n,
a, a 2 , , a ( n ) are congruent to a1 , a2 ,, a ( n) in some order.

Corollary. If n has a primitive root then it has exactly    n  of them.

Proof. Suppose that a is a primitive root of n. Then a must be congruent to one of


a1 , a2 ,, a ( n) where a1 , a2 ,, a ( n) are positive integers less than n relatively prime to n.

We know that a, a 2 , , a ( n ) are congruent modulo n to a1, a2 ,......a  n in some order.

Further number ak ,1  k    n  has order   n  if gcd  k,   n   1. Hence, there are

exactly    n  primitive roots of n.

Ex.2. Find the order of the integers 2, 3 and 5 modulo 17.

Solution. Consider the factors 2, 4,8,16 of  (17)  16 . Now 22  1(mod17), 24  1(mod17)


but 28  1(mod17) .Therefore, order of 2 modulo 17 is 8. Hence, 2 is not primitive root of
17.Next, 32  1(mod17),34  1(mod17),38  1(mod17) but 316  1(mod17) .Therefore, order
of 3 modulo 17 is  (17)  16 . Hence, 3 is a primitive root of 17. Further,
52  1(mod17),54  1(mod17),58  1(mod17) but 516  1(mod17) . Hence, 5 is a primitive root
of 17.

Ex.3. Prove that   2n  1 is multiple of n for any n > 1.

Solution. Since, 2n  1 mod 2n  1 , therefore 2 has order n modulo 2 n  1 .

Therefore, n |   2n  1

Ex.4. If p is a composite number such that 2 p  1 is prime then p is a pseudoprime.

Solution. Since 2 p  1 mod 2 p  1 therefore 2 has order p modulo 2 p 1 .

 
Therefore, p |  2 p  1  2 p  2 .Hence, p is pseudoprime.

Ex.5. Assume that order of a modulo n is h and the order of b modulo n is k. Show that
order of ab modulo n divides hk. In particular, if gcd  h, k   1, then order of ab is hk.
h k hk
Solution. Given that a  1 mod n  and b  1 mod n  . Thus,  ab   1 mod n  .

Number Theory | 83
Thus, order of ab modulo n divides hk. Note that, ab    1 mod n  . Therefore, if
1cm h , k

gcd  h, k   1, then lcm(h, k )  hk and hence, order of ab is hk.

Ex.6. The odd prime divisors of the integer n 2  1 are of the form 4 k  1
2
Solution. Let p be an odd prime divisor of n 2  1 then n 1  0  mod p  .

 n2   1 mod p

 n4  1 mod p 

 4|   p  p 1

 p  4k  1 .

Ex.7 The odd prime divisors of the integers  n4  1 are of the form 8k  1.

Solution. Let p be a prime divisors of n 4  1 .Then

n4 1  0  mod P

n4   1 mod P
2
n8   1  mod P 

n8  1 mod P

8|   p  p 1

 p  8k  1 .

Exercises
1. Find the order of the integers 2, 3 and 5
a) modulo 19 b) modulo 23.
2. Find orders of all the positive integers less 13, which of them are primitive roots of 13.
7.2 Primitive Roots for Primes

Theorem. (Lagrange) If p is a prime and, f  x   an xn  an1xn1  ....  a1x  a0


a n  0  mod p   is a polynomial of degree n  1 with integral coefficients then the
congruence f ( x)  0(mod p) has at most n incongruent solutions modulo p.

Proof. We shall prove this theorem by induction on n. Let n = 1 then f  x   a1x  a0 .

Since gcd(a1 , p)  1 the linear congruence a1 x   a0 (mod p ) has a unique solution.


Number Theory | 84
Hence, a1 x  a0  0(mod p ) has unique solution for n = 1.

Suppose that the result holds for n = k – 1. Let f  x  be a polynomial of degree k.

If f ( x)  0(mod p) has no solution then there is nothing to prove.

Let f ( x)  0(mod p) have a solution a . By division algorithm we have


f  x   x  a g  x  r, where r is constant. i.e. r is an integer and deg  g  x   k 1 .

Since a is a solution of f ( x)  0(mod p) ,we have f (a)  0(mod p) .

Hence , 0  f (a)  (a  a) g (a)  r  r (mod p)

Thus, r  0(mod p) .

Hence, f ( x)  ( x  a) g ( x)(mod p) .

Let b be any other solution of f ( x)  0(mod p) other than a .

Then, 0  f  b    b  a  g  b mod p  .

Since, (b  a)  0(mod p) , we have g (b)  0(mod p) .

Thus any solutions of f ( x)  0(mod p) other than a is a solution of g ( x)  0(mod p) .

Since g  x  is of degree k 1, g ( x)  0(mod p) can have at most k – 1 zeros incongruent


modulo p.

Thus f ( x)  0(mod p) can have at most  k 1 1  k incongruent solutions modulo p.

Hence, the result follows by principle of induction.

Corollary. If p is a prime number and d | p  1 , then the congruence x d  1  0(mod p) has


exactly d solutions.
Proof. Since d | p  1 we have dk  p  1 where k is an integer then

x p 1  1  x dk  1
k
 xd  1


  xd  1  xd 
k 1

 .....  1 .

Let f (x) = (xd) k-1 + (xd) k-2 + ... + 1.

Note that, deg  f  x   d  k 1  p 1  d and that f  x  has integral coefficients.

By Lagrange’s theorem, f ( x)  0(mod p) can have most p – 1 – d solutions incongruent


modulo p.
Number Theory | 85
By Fermat’s Theorem x p 1  1(mod p ) has precisely p – 1 solutions incongruent modulo p,
namely the integers 1, 2,, p  1 .

 
Observe that 0  a p 1  1  a d  1 f (a)(mod p) with p | f (a) implies that p | a d  1 .

Hence, any solution x  a(mod p) of x p 1  1  0(mod p ) other than the solution of


f ( x)  0(mod p) must satisfy x d  1  0(mod p) . Thus x d  1  0(mod p) must have at least
p  1  ( p  1  d )  d solutions. Since x d  1  0(mod p) can have at most d solutions, it must
have exactly d solutions.

Using this corollary we can prove Wilsons theorem


Theorem. (Wilson’s theorem)
If p is prime, ( p  1)!  1(mod p) .

Proof. Consider f  x    x  1 x  2  ......  x   p  1    x p 1  1

 a p2 x p2  a p3 x p3  .......  a1x  a0

where , a0 , a1 , , a p  2 are integers and that degree of f  x  is p – 2 .

We know that x p 1  1  0(mod p ) has exactly (p – 1) incongruent solutions modulo p.


By construction each of 1 to p – 1 is a solution of f ( x)  0(mod p) and that 1, 2,…, (p – 1) are
incongruent modulo p.

Since degree of f  x  is p – 2 by Lagrange’s theorem f ( x)  0(mod p) can have at


most p – 2 incongruent solutions modulo p.
This is possible only if
a p 2  a p 3    a1  a0  0(mod p) .

Thus ( x  1)( x  2) ( x  ( p  1))  ( x p 1  1)  0(mod p ) holds for any integer x .

Therefore, for x  0, we obtain

(1)(2) (( p  1))  1(mod p )  (1) p 1 ( p  1)!  1(mod p ) .

If p is odd prime then p – 1 is even and for p=2, we have 1  1  0(mod p) . Hence,

( p  1)!  1(mod p) .
This proves Wilson’s theorem .

Number Theory | 86
Theorem. If p is a prime number and d | p  1 , then there are exactly   d  incongruent
integers having order d modulo p.

Proof. Suppose d | p  1 . Let   d  denote the number of integers k, 1  k  p  1 that have

order d modulo p. Since each integer 1, 2,, p  1 has order d, for some d |  p 1 .

Thus, p  1    (d ) .
d | p 1

By Gauss’ theorem

p 1    (d ) .
d | p 1

Thus   (d )    (d )
d | p 1 d | p 1
------ (1)

Claim -   d     d  for each divisor d of p – 1 .

Let d be an arbitrary divisor of p – 1, then either   d   0, or   d   0 , If  (d) = 0, then

  d     d  holds trivially.

Suppose   d   0 then there is an integer a such that order of a modulo p is d with

gcd  a, p  1.

Further, a, a2, ... , a d are incongruent modulo p and that each of them satisfies the polynomial
congruence

x d  1  0(mod p) (2)

for (a k ) d  (a d ) k  1k  1(mod p) for k  1, 2,, d .

Therefore, by corollary to Lagrange’s theorem, there can be no other solution of Equation(2).


Thus any integer having order d modulo p must be congruent to one of a , a 2 , ......, a d
modulo p. But only   d  integer amongst a , a 2 , ......, a d can have order d modulo p. In

other words a k has order d modulo p if and only if gcd  k, d   1 . Thus   d     d  that is,

the number of integers having order d modulo p is equal to  (d ) .Thus   d     d  .

In view of Equation (1) we must have   d    d  otherwise L.H.S. of (1) would be less
than R.H.S. of (1) which is not possible. Hence, the result.

Corollary. If p is a prime, then there are exactly   p 1 incongruent primitive roots.

Number Theory | 87
Proof. Any primitive root of p has order  ( p)  p  1 . Therefore, number of primitive roots
of p is exactly   p 1 .

e.g. Let p = 13 then the divisors of p – 1 = 13 – 1 = 12 are 1, 2, 3, 4, 6,12.


Order of 1 modulo 13 is 1
Order of 2, 6, 7, 11 is 12
Order of 3, 9 is 3
Order of 5, 8 is 4
Order of 4, 10 is 6
Order of 12 is 2

It is interesting to note that, the number of incongruent solutions of x 6  1 mod13  is indeed


the sum of integers of order 6, 3, 2 and 1. Thus the number of incongruent solutions of
x 6  1 mod13  is 2 + 2 + 1 + 1 = 6, namely 4, 10 of order 6; 3, 9 of order 3; 12 of order 2; 1
of order 1.

Ex.1. If p is a prime of the form 4k + 1, then the quadratic congruence x 2  1(mod p) ,admits
a solution.

Solution. Since 4| p 1    p there is an element a of the order 4, that is a 4  1(mod 4) .


Thus, (a 2  1)(a 2  1)  0(mod p )  a 2  1(mod p ) or a 2  1(mod p) .

Since order of a modulo p is 4, a 2  1(mod p) is not possible. Hence a 2  1(mod p) so that


x 2  1(mod p) has a solution.

Ex.2. If p is an odd prime, prove that the only incongruent solutions of x 2  1(mod p ) are 1
and p – 1

Solution. We know that x 2  1(mod p ) has 2 incongruent solutions modulo p.

Since 1 and 1 – p are already solutions of x 2  1(mod p ) , they are the only two incongruent
solutions of x 2  1(mod p ) .

Ex.3. If p is an odd prime, prove that congruence x p 2  x p 3    x  1  0(mod p)

has exactly p – 2 incongruent solutions and they are the integers 2,3,, p  1.

Solution. We know x p 1  1  0(mod p ) has solution 2,3,, p  1.

Since x p 1  1   x  1  x P  2  .....  x  1 and x  1(mod p) has solution 1.

Therefore, x p 2  x p 3    x  1  0(mod p) has solutions 2,3,, p  1.

Number Theory | 88
Not let us recall the results :
Let gcd(a, n) =1 and let a1, a2,..., a  n  be the positive integers less than n and relatively prime
n
to n. If a is a primitive root n, then a, a 2,..., a  are congruent modulo n to a1, a2,..., a  n  in
some order.
And
Let a have order k modulo n. Then ak also has order k if and only if gcd(h, k) = 1.
The later can be rephrased as

Let a be a primitive root then a have order   n  modulo n. Then ah also has order   n  if
and only if gcd  h,   n    1 . This is equivalent to the statement.

An integer ah is a primitive root of n if and only if gcd  h,   n    1 .

Thus if, we can begin with the smallest primitive root a of an integer n (if exists), then we
can use it to find other primitive roots. Interestingly, we need not have to search too far for
smallest primitive root as most primes have either 2 or 3 as their primitive root. Let us
consider p = 23, by trial and error we can ensure that 5 is the smallest primitive root. Now we
can begin with this primitive root and compute others. In view of above result 5h is a
primitive root if gcd  h,   23   gcd  h, 22   1 that is, h = 1, 3, 5, 7, 9, 13, 15, 17, 19, 21 and
so 5,53,55, 57,59,513,515, 517,519, 521 are primitive roots. Consider,

53  5  25  5  2  10  mod 23  ,55  53  52  10  25  10  2  20  mod 23  ,

57  55  52  20  2  17  mod 23  , 59  57  5 2  17  2  11  mod 23  ,

511  11 25  11 2  22  mod 23  , 513  22  25  22  2  21 mod 23  ,

515  21 25  21 2  19  mod 23  , 517  19  25  19  2  15  mod 23  ,

519  15  25  15  2  7  mod 23  , 521  7  25  7  2  14  mod 23  .

Thus the primitive roots are 5, 7, 10, 11, 14, 15, 17, 19, 20, 21. Observe that the number of
primitive roots incongruent modulo 23 is    23     22    11  10 . Here we have also
calculated 511 for our calculation purpose.

Note that there are 5 pairs 5,521 , 53, 519 , 55, 517 , 57,515 , 59,513 such that
rr '  1 mod 23 .
This can also be used to find integers of given order from smallest primitive root. Recall the
result :

Number Theory | 89
k
Let a have order k modulo n. Then ah also has order .
gcd  h, k 

 n
Thus, if a is a primitive root, then order of a is   n  so that ah has order .
gcd  h,   n  

We can use this result to find integers of a given order from a primitive root.
Let us consider p = 13 and it's primitive root 2. Let us find integers of order 6. Here,
 13  12 , so the integers of order 6 are those integers 2h with

12
6  gcd  h,12   2  h  2,10 .
gcd  h,12 

Thus 22, 210 are integers of order 6. Now, 22  4, 210  1024  10  mod13  . Therefore, 4 and
10 are integers of order 6.
Let us discuss how to find the number of integers of a given order k modulo n.
 n
Let n be an integer having primitive root a, then a, a 2,..., a are congruent to a1, a 2,..., a  n 

k
in some order. Further, if a have order k modulo n. Then ah also has order .
gcd  h, k 

 n
Thus if, a is a primitive root, then order of a is   n  so that ah has order . Thus
gcd  h,   n  
  n
integers of order k are those ah for which  k that is, we have to find h such
gcd  h,   n  
 n
that  gcd  h,   n   . Let us consider p = 43. Here,   43  42 , so that there are
k
integers of order 1, 2, 3, 6, 7, 14, 21, 42. First we shall find a primitive root of 43. Let us start
with 2. We have

25  32  11 mod 43 , 26  21 mod 43  , 27  1  mod 43  and


2
214   27    1  1 mod 43  .
2

Thus 2 is not a primitive root. Consider

34  81  5  mod 43  , 36  34  32   5  9   2  mod 43  ,37  6  mod 43  ,


314  36  7  mod 43

Thus 321  314  37   7  6   1 mod 43 . Hence, 3 is primitive root of 43.

Number Theory | 90
Power of 3 No. cong. Power of 3 No. cong. Power of 3 No. cong.
mod 43 mod 43 mod 43
1 03 15 22 29 18
2 09 16 23 30 11
3 27 17 26 31 33
4 38 18 35 32 13
5 28 19 19 33 39
6 41 20 14 34 31
7 37 21 42 35 07
8 25 22 40 36 21
9 32 23 34 37 20
10 10 24 16 38 17
11 30 25 05 39 08
12 04 26 15 40 24
13 12 27 02 41 29
14 36 28 06 42 01
Table 1
Clearly, only element of order 1 is 1,
42
Now integers of order 2 are those 3h for which  gcd  h, 42   gcd  h, 42   21  h  21 .
2
Thus there is only one integer of order 2, namely 321  1  42  mod 43 , that is 42.

42
Next integers of order 3 are those 3h for which  gcd  h, 42   gcd  h, 42  14  h  14, 28 .
3
Thus there two integer of order 3, namely 6 and 36.
42
Now integers of order 6 are those 3h for which  gcd  h, 42   gcd  h, 42   7  h  7,35 .
6
Thus there are 3 integers of order 6, namely 37, 7.
Further, integers of order 7 are those 3h for which
42
 gcd  h, 42   gcd  h, 42   6  h  6,12,18, 24, 30,36 . Thus there are 6 integers of
7
order 7 namely 41, 4, 35, 16, 11, 21.

Number Theory | 91
Further, integers of order 14 are those 3h for which
42
 gcd  h, 42   gcd  h, 42   2  h  2, 4,8,10,16, 20, 22, 26,32,34, 38, 40 . Thus there are
21
12 integers of order 21, namely 9, 38, 25, 10, 23, 14, 40, 15, 13, 31, 17, 24.
Finally, integers of order 42, that is, primitive roots are those 3h for which
42
 gcd  h, 42   gcd  h, 42   1  h  1,5,11,13,17,19, 23, 25, 29,31,37, 41 . Thus there are
42
12 primitive roots for 43, namely 3, 28, 30, 12, 26, 19, 34, 5, 18, 33, 20, 29.

Note that there are 6 pairs 2, 241 , 25, 237 , 211, 230 , 213, 229 , 217, 228 , 219, 223 such that
rr '  1 mod 43 .
Let us put it in tabular form.
Sr. No. Order Integers No. of integers
1 1 1 01
2 2 42 01
3 3 6, 36 02
4 6 7, 37 02
5 7 4, 11, 16, 21, 35, 41 06
6 14 2, 8, 22, 27, 32, 39 06
7 21 9, 10, 13, 14, 15, 17, 23, 24, 25, 31, 38 12
8 42 3, 5, 12, 18, 19, 20, 26, 28, 29, 30, 33, 34 12
Total 42

Ex. Find all positive integers less than 61 having order 4 modulo 61.
Solution. Let us find smallest possible positive primitive root modulo 61. Let us begin with
2. Consider the nearest power of 2 to 61. Note that   61  60 and divisors of 60 are 1, 2, 3,
4, 5, 6, 12, 15, 20, 30, 60. We have 28  12  mod 61 , 212  28  2 4  12 16  9  mod 61 ,

215  212  23  9  8  11 mod 61 so 220  212  28  9  3  27  mod 61 ,


2
230   215   11  121  1 mod 61  260  1  mod 61 .
2

Thus 2 is a primitive root. The positive integers less than 61 having order 4 are those 2h for
60
which  gcd  h, 60   gcd  h, 60   15  15, 45 . Thus 215  11 mod 61 and
4
Number Theory | 92
245  230  215   111  50  mod 61 . Hence 11 and 50 are two integers of order 4
modulo 61.
Exercises :
1. Assuming that r is primitive root of the odd prime p, then prove that
r  p1 /2  1 mod p  .

2. Assuming that r is primitive root of the odd prime p, and r' is another primitive root
of p, then prove that rr' is not a primitive root of p.
3. For a prime p > 3, prove that the primitive roots of p occur in incongruent pairs r, r'
where rr '  1 mod p  .

4. Let r be a primitive root of the odd prime p. Then prove the following :

(a) If p  1 mod 4  , then r is primitive root of p.

(b) If p  3  mod 4  , then r has order  p  1 / 2 modulo p.

7.3 Composite Numbers having primitive root


Theorem. For k  3 then integer 2 k has no primitive roots.
Proof. We shall prove this result by induction on k. However, we begin by showing that if a
k 2
is an odd integer then, a 2  1  mod 2 k  . ...... (1)

For k = 3 this holds trivially because we know that square of an odd integer is of the form
2
8k + 1, i.e. if a is an odd integer a  1 mod8 .

Suppose k > 3.Let the result (1) holds true for k, that is, our induction hypothesis is
k 2
a2  1  mod 2 k  .
k 2
Therefore, a 2  1  b 2k , where b is an integer.
Consider
2 2
k 1
a2  a2    1  b2 
k 2
k
 1  b2k 1  b 2 22 k  1  2k 1  b  b 2 2k 1   1(mod 2 k 1 ) .

k 1
Thus, a 2  1  mod 2 k 1  .

Therefore, (1) holds for k + 1 whenever it holds for k.


Hence, by principle of mathematical induction (1) holds for all k  3 .

Note that, the integers that are relatively prime to 2 k are the odd integers . This is to support
the choice of a as odd integer in (1) and   2 k   2 k / 2  2 k 1 .

Number Theory | 93
Thus a 2
k 2
a
   1(mod 2k )
 2k / 2

k k
  2k 
Thus 2 has no primitive root because order of a modulo 2 is less than or equal to .
2

Theorem. If gcd  m, n  1, where m  2 and n  2 then the integer mn has no primitive root.

Proof. Let be a an integer such that gcd  a, mn  1, that is, gcd  a, m  1 and gcd  a, n   1.
Let h  lcm( (m),  (n)) and d  gcd( (m),  (n)) .

Since   m and   n  are even integers, we have d  2 .

  m   n    m   n    mn 
Hence, h    .
d 2 2
  m  ( n )/ d
By Euler’s theorem, a  1 mod m  so that a h   a ( m )   1 ( n )/ d  1(mod m) .

Similarly, a h  1(mod n) . Since gcd(m, n)  1  a h  1(mod mn) .

Thus, a ( mn )/ d  1(mod mn) . Thus, order of a modulo mn is less than or equal to


  m   n   mn   mn
     mn .
d d 2
Thus mn cannot have primitive roots.
Corollary. The integer n fails to have primitive root if either.
a) n is divisible by two odd primes or
b) n is of the form n  2 m  p k ,

where p is an odd prime and m  2 .


Proof. a) Let n  pq where p and q are distinct odd primes. Hence p  2 and q  2 and above
theorem applies.

b) Since p is odd prime we have gcd  2 m , p k   1 and as m  2 , 2 m  2 & p k  2 .


Therefore, above theorem applies.
Lemma. If p is an odd prime then there exists a primitive root r of p such that
r p 1  1(mod p 2 ) .

Proof – Since p is an odd prime, it has a primitive root. Let r be one of the primitive roots of
p. If r p 1  1(mod p 2 ) we are through.

Suppose r p 1  1(mod p 2 ) then let r '  r  p and

Number Theory | 94
p 1 p 1 ( p  1)( p  2) 2 p 3
consider,  r '  r  p  r p 1  ( p  1) pr p 2  p r  to p terms.
2!
p 1
Thus  r '  r p 1  ( p  1) pr p 2 (mod p2 ) .
p 1
Since, r p 1  1(mod p 2 ) , we have  r '  1  pr p  2 (mod p 2 ) .

Since, r is a primitive root of p,gcd(r , p)  1 , we obtain p | r p  2 . Note that as r is a primitive


p 1
root so does r '  r  p . Hence,  r '   1(mod p 2 ) proves the lemma.

Corollary. If p is an odd prime then p 2 has primitive root. In fact for a primitive root r of p
either r or r + p (or both) is a primitive root of p 2 .

Proof. Since p is an odd prime, p has a primitive root r. We know that either
p 1
r p 1  1(mod p 2 ) or  r  p   1(mod p 2 ) . Since,   p 2   p  p  1 we must have

r p 1  1(mod p 2 ) or (r  p) p 1  1(mod p 2 ) .

So that r or r + p is a primitive root of p 2 . Note that if r p 1  1(mod p 2 ) , order of r modulo


p 1
p 2 must be   p 2   p  p  1 and similarly if  r  p   1(mod p 2 ) , order of r modulo

p 2 must be   p 2   p  p  1 .

Ex. Find primitive roots of 25.


Solution. We know that 2, 3 are the primitive roots of 5. Note that there are
   25      20   8 primitive roots of 25. We know that if r is a primitive root of p then r
or r + p is a primitive root of p2. Therefore, 2 or 7 and 3 or 8 are primitive rots of 25. Observe
that 24  1 mod 25  and 34  1 mod 25 . Therefore, 2 and 3 are primitive roots of 25.
However, there are six more primitive roots of 25 which can be found by brute method or
starting with 2 or 3. Now let us take 2. The primitive roots of 25 are those powers h or 2 such
that gcd(h, 20) - 1. Thus h = 1, 3, 7, 9, 11, 13, 17, 19. Thus 23  8 , 27  128  3  mod 25 ,
29  12  mod 25  , 211  23  mod 25 , 213  17  mod 25 , 217  22  mod 25  , 219  13  mod 25 .
Thus the primitive roots are 2, 3, 8, 12, 13, 17, 22, 23.
Note. In the above example 2 and 3 are primitive root of 5 as well as 25. Further, 2 is
primitive root but 2 + 5 = 7 is not where as both 3 and 3 + 5 = 8 are primitive roots. Note that
7 4  1 mod 25 . Thus r p1  1 mod p 2  guarantees that r is primitive root of p2. Further 3,
8, 13, 23 are congruent modulo 5 and 2, 12, 17, 22 are congruent modulo 5. Also
7  18  mod 25  implies 7 4  184  1 mod 25 . The next result assures that if r is a
primitive root of p with the property that r p1  1 mod p 2  , then r is a primitive root of pk
for each positive integer k  2 .
Number Theory | 95
Lemma. Let p be an odd prime and let r be a primitive root of p with the property that
k 2
r p 1  1  mod p 2  . Then for each positive integer k  2 , r p ( p 1)
 1(mod p k )

Proof. We shall prove this result by induction on k. For k = 2, the result holds trivially ,
n2
Suppose that the result holds for k = n, i. e., r p ( p 1)
 1(mod p n ) .

Since gcd(r , p n 1 )  gcd(r , p n )  1 , by Euler’s theorem, we obtain

r

 p n1   1(mod p n 1 )  r p n2
( p 1)
 1(mod p n 1 )  1  ap n 1 ,
n2
for some integer a such that, p | a , otherwise, we would have, r p ( p 1)
 1(mod p n )

which is absurd.
Now consider
p
k 1 p
rp
n1
( p 1)
 rp  n2
( p 1)
  1  ap   1  p  a  p k 1   .

n 1
Thus r p ( p 1)
 1  ap n (mod p n 1 ) .

As p | a , we have
n 1
rp ( p 1)
 1(mod p n 1 ) .

Therefore the result holds true for any k by induction.

Theorem. If p is an odd prime and k  1 , then there exists a primitive root for pk.
Proof. We know that, if p is an odd prime then there is a primitive root r modulo p such that
r p1  1 mod p 2  and that for such an r, for each positive integer k  2,
k 2
rp  p 1
 1 mod p k  . Thus it is enough to find an r such that r p1  1 mod p 2  which
serves as a primitive root for all powers of p.

Let n be the order of r modulo pk, then n must divide   p k  | p k 1  p  1 . Since n is the order
of r modulo pk, we have r n  1 mod p k  which implies that r n  1 mod p  . Therefore,
  p   p  1| n . Thus n has the form n  p m  p  1 , where 0  m  k  1 . In case m  k  1 ,
k 2
then we would have n | p k  2  p  1 and we get r p  p 1
 1 mod p k  which contradicts our
k 2
assumption that r p  p 1
 1 mod p k  . Therefore, n  p k 1  p  1 , that is, r is primitive
root modulo pk for any integer k  1 .

Number Theory | 96
Finally we consider the case 2pk, where k  1 .
Corollary. There are primitive roots for 2pk where p is an odd prime and k  1 .
Proof. We know that pk with k  1 has primitive root and let r be a primitive root for pk.
With no loss of generality, we may take r to be an odd integer, for if it were even then r + pk
would be an odd primitive root for pk. Since r is odd, we have gcd  r, 2p k   1 . Let n be
the order of r modulo 2pk. Then r must divide   2p k     2    p k     p k  . Now
r n  1 mod 2p k   r n  1 mod p k  . Therefore,  2p k  | n . On the other hand
n |  2p k     p k  . Thus n    p k  and consequently, r is primitive roots for 2pk.

Note that 1 primitive roots for 2, 3 is primitive root for 4 and thus we summarize.
Theorem. An integer n > 1 has a primitive root if and only if n = 2, 4, pk or 2pk.
Ex. Find four primitive roots of 26.
Solution. The integer 26 is of the form 26  2 13 , that is of the form 2p and therefore, it has
primitive roots. We begin by evaluating   26     2 13   13  12 . Therefore, order of
any integer relatively prime to 26 is divisor of 12. Note that the divisors of 12 are 1, 2, 3, 4, 6,
12. Further, there are exactly   13    12     3   4   2  2  4 primitive roots. We
can directly find the primitive roots or use the method of obtaining the primitive roots
starting from the smallest primitive root. Let us do it directly. The integers relatively prime to
26 are 1, 3, 5, 7, 9, 11, 15, 17, 19, 21, 23, 25. Clearly, 33  27  1 mod 26  so order of 3 is 3.
Next, 52  25  1 mod 26   54  1 mod 26  so that order of 5 is 4. Now
7 2  49  3  mod 26  , 73  7 2  7  3  7  5  mod 26  and

76  52  1 mod 26   712  1 mod 26  , that is, order of 7 is 12, hence 7 is primitive root.
3 2
Clearly, 93   32    33   1 , therefore, 9 is not a primitive root. Now, 112  121  17  mod 26 
2
and, 113  112 11  17 11   911  5  mod 6  thus 114  112    9  9   81  3  mod 26  .
2
Next 116  113   52  1 mod 26  therefore, order of 11 is 12, that is 11 is also a primitive
2 2 2
root modulo 26. Consider, 15  11 mod 26  , 15    11  11   9  mod 26  ,
3 2 4 2 2
further, 15   15  15    9   11  5  mod 26  , 15   15    9   3  mod 26  and
2
15 6  153    5  2  1 mod 26  , therefore, 15 is a primitive root for 26. Thus we have
found 3 primitive roots and obvious guess for the fourth one is 19 as 19  7  mod 26  and
3 3
we are just required to verify that 19   1 mod 26  and 19   1 mod 26  . For that it is
enough to see that  7 3   7 2  7    7 2  7    3 7   5  mod 26  so

Number Theory | 97
 7 3  19 3  5  mod 26  Thus the fourth primitive root is 19. Thus once we verify that 7
and 11 are primitive roots obvious guess are 19 and 15.

Alternatively, once we obtain 7 as the smallest primitive root, the other three are 75, 77, 711 .
2 2
Consider 72  49  3 mod 26 , 73  72  7   3  7  5  mod 26 , 74   72    3  9  mod 26
therefore, 75  72  73   3  5  11 mod 26  , 77  7 4  73  9  5  19  mod 26  , and

711   7 7  7 4   19  9   7  9  15  mod 26  . Thus the four primitive roots are 7, 11, 15, 19.

Let us find integers of order 6 modulo 26. Here,   26    13  12 , so the integers of order
  26  12
6 are those integers 7 h with h  6  gcd  h,12   2  h  2,10
gcd  h,   26  gcd  h,12 
. Thus integers of order 6 modulo 26 are 7 2, 710 . Thus smallest positive integers of order 6
2 2
modulo 26 are, 7 2  49  23  mod 26  , 73  5  mod 26   76   73    5   25  mod 26 
and 710  76  7 2  7 2   1   3 3  9  17  mod 26  . Thus integers of order 6 modulo 26
are 17, 23. However, one is tempted to wonder if 3, 9 are also integers of order 6, but both
2
are clearly ruled out, for 33  1 and 93   33   12  1 .

Now let us find integers of order 3 modulo 26. Here,   26    13  12 , so the integers of
order 3 are those integers 7h with

  26  12
h 3  gcd  h,12   4  h  4,8 .
gcd  h,   26   gcd  h,12 
2 2
Thus the integers of order 3 are, 7 4   72    3  9  mod 26  and
2 2
78   7 4    9   3  mod 26  , that is 3 and 9 are integers of order 3 modulo 26.

Now let us find integers of order 2 modulo 26. Here,   26    13  12 , so the integers of
order 2 are those integers 7h with

  26  12
h 2  gcd  h,12   6  h  6 .
gcd  h,   26   gcd  h,12 

Thus the integer of order 2 is, 76  25  mod 26  . Thus 25 is integers of order 2 modulo 26.
Similarly, the integers of order 4 are those integers 7h with

  26  12
h 4  gcd  h,12   3  h  3,9 and hence, the integers of
gcd  h,   26   gcd  h,12 

Number Theory | 98
order 3 are, 73  5  mod 26  and 79   78   7  3  7  21  mod 26  . Thus 5 and 21 are integers
of order 4 modulo 26.
In general we can list the integers as follows :

Primitive roots are 7, 75, 7 7, 711 ; that is 7, 11, 15, 19.

Integers of order 6 modulo 256 are, 7 2, 7 6, 710 ; that is 17, 23,

integers of order 4 modulo 26 are, 73, 79 ; that is5, 21,

integers of order 3 modulo 26 are, 74, 78 ; that is, 3, 9,

integers of order 2 modulo 26 is, 76 ; that is, 25,


Integers of order 1 modulo 26 is, 1.
Ex. Find all primitive roots of 41 and 82.

Solution. Consider 25  9  mod 41 , 210  1 mod 41 , so 2 is not a primitive root of 41.
Next 34  1 mod 41 implies that 3 is also not a primitive root of 41. Further,
45  210  1 mod 41 and hence 4 is also not a primitive root. Now 53  2  mod 41 ,
56  4  mod 41 , 54  10  mod 41 , 510  56  54   4   10   1 mod 41 therefore, 5 is
also not a primitive root. Consider, 62  5  mod 41 , 64  25  mod 41 ,
66  64  6 2  2  mod 41 , 610  66  64  9  mod 41 . Thus 620  1 mod 41 and hence 6 is
primitive root of 41.
Now 6 being an even integer it cannot be a primitive root of 82 and hence, 6 + 41 = 47 is
primitive root of 82.
Notes :

1. Clearly, 2 is primitive root of 3 and 22  4  1 mod 9  , so 2 is primitive root of all


powers of 3.

2. Since   2p n     p n  , they have same number of primitive roots.

3. Any primitive root of p2 is also a primitive root of pn for n  2 .

Exercise :

1. Prove that 3 is a primitive root of all integers of the form 7 k and 2  7 k .


2. Prove that any primitive root r of pn is also a primitive root of p.


Number Theory | 99
7.4 THE THEORY OF INDICES
Consider the Table 1. In this table we have we out powers of primitive root 3 and the
positive integers less than 43 congruent to it modulo 43. However, if we take any other
primitive root and the table would be different. Thus for a given primitive root we can always
work out such a table. For example, we have 335  7  mod 43 and in this case we say that
index of 7 relative to (primitive root) 3 is 35. Similarly, 329  18  mod 43 and in this case we
say that index of 18 relative to (primitive root) 3 is 29.
The concept of indices was introduced by Gauss. Let n be any integer that admits a
primitive r. We know that,   n  the integers r, r 2 , ...., r   n  are congrnent modulo n to
a1 , a2 ,...., a  n  , the   n  integers less than n and relatively prime to n. In other words each
integer a such that gcd  a, n   1 can be expressed as a  r k  mod n  for a suitable choice
of k, where 1  k    n  . This idea prompts the following definition.

Definition : Let r be a primitive root of n and gcd  a, n   1 . Then the smallest integer k such
that a  r k  mod n  is called index of a relative to r and is denoted by ind r a .
Notes :

1. Clearly, 1  ind r a    n  .

2. Whenever we talk about index it is assumed that gcd  a, n   1 .

3. If a  b  mod n  then ind ra  ind rb that is r ind,a  r ind,b  mod n  .

Clearly, 1  ind r a    n  and that r ind r a  a  mod n  .


e.g. Let us consider n = 5 and primitive root r = 2 of 5. Then

21  2  mod 5  , 22  4  mod 5  , 23  3  mod 5  and 24  1 mod 5  .

Thus ind 2 1  4 , ind 2 2  1 , ind 2 3  3 and ind 2 4  2 .

Note that a  b  mod n   ind a  ind b .

Let a  b  mod n  and r be a primitive root of n.

Then r ind a  a  mod n  and r ind b  b  mod n  .

Number Theory | 100


Thus r ind a  r ind b  mod n  .

Therefore, ind a  ind b  mod   n   which is possible only if ind a  ind b . Thus,
when setting up tables of values of ind a, it is enough to take integers less than a and relatively
prime to n.

Theorem : If n has a primitive root r and ind a denotes index of a relative to r, then the
following properties hold.

(a) ind ab  ind a  ind b  mod   n  

(b) ind a k  k ind a  mod   n   for k  0

(c) ind 1  0  mod   n   , ind r  1  mod   n  


Proof : By definition of index

(a) r ind a  a  mod n  and r ind b  b  mod n 

Therefore r ind a + ind b  ab  mod n  .

Since r ind ab  ab  mod n  we have r ind a  ind b  r ind ab  mod n  .

Hence, ind a  ind b  ind ab  mod   n   .

(b) Note that r ind ak  a k  mod n  .

And r k ind a   r ind a k  a k  mod n  .

Hence, r ind ak  r k ind a  mod n  .

Therefore, ind a k  k ind a  mod   n   .

(c) Finally, r   n   1 mod n   ind 1  0  mod   n   and ind r  1 mod   n   .

The theory of indices can be used to solve certain types of congruences. Consider the
binomial congruence.

x k  a  mod n  ( k  2) ...... (1)

Number Theory | 101


where n is a positive integer having primitive root and gcd  a, n   1 . In view of above theorem
(1) is equivalent to the linear congruence.

k ind x  ind a  mod   n   ...... (2)

Let d  gcd  k,   n   . If d | ind a then (2) is not solvable. However, if d | ind a ,


then (2) has exactly d values of index modulo   n  . Consequently, there are d solutions of
(1).
Consider the case k = 1, n = p where p is odd prime. In this case (1) becomes,

x 2  a  mod p  ...... (3)

Since gcd  2, p  1  2 , (3) has two solutions provided 2 | ind a.


Let r be a primitive root of p. Then r, r2, ...., rp–1 are congruent modulo p to 1, 2, ..,
p–1 in some order. The even powers of r produce the values of a for which the congruence
x 2  a  mod p  is solvable. Note that there are precisely  p  1 / 2 such choices for a.

Example : Solve 4x9  7  mod13 ..... (1)


Solution : The above equation can be solved using theory of indices. Let us fix 2 as primitive
root of 13. Note that,

21  2  mod13 , 22  4  mod13 , 23  8  mod13

24  3  mod13 , 25  6  mod13 , 26  12  mod13

27  11 mod13 , 28  9  mod13 , 29  5  mod13

210  10  mod13 , 211  7  mod13 , 212  1 mod13 


Thus index table can be written as,
a 1 2 3 4 5 6 7 8 9 10 11 12
ind a 12 1 4 2 9 5 11 3 8 10 7 6
Now (1) has a solution iff

ind 2 4  9ind 2 x  ind 2 7  mod12 

Number Theory | 102


 2  9ind 2 x  11  mod12 

 9ind 2 x  9  mod12 

 ind 2 x  1 mod 4 

 ind 2 x  1,5,9
Looking at the index table, we obtain

x  2,5 or 6  mod13 

Note : Let us consider p = 13. We can obtain   13   4 primitive roots of 13. If we
know one of them. Let us start with 2. Infact remaining 3 can be obtained from the powers
2k 1  k    n   where gcd  k,  13   gcd  k,12   1 . They are
5 11
21  2 , 2  6 , 27  11 , 2  7  mod13 .

Theorem : Let n be an integer possessing primitive root and let gcd  a, n   1 . Then the
congruence x k  a  mod n  has a solutions if and only if
n / d
a  1 mod n 

where d  gcd  k,   n   , if it has a solution, there are exactly d solutions modulo n.

Proof : Taking indices, the congruence a  n  / d  1 mod n  is equivalent to

 n
ind a  ind 1 mod   n   .
d

Since ind 1  0  mod   n   , we obtain.

 n
ind a  0  mod   n  
d

 ind a  0  mod d 
 d | ind a

Number Theory | 103


But this is necessary and sufficient condition for congruence x k  a  mod n  to be
solvable. However, if the congruence has solution, then there are exactly d solutions modulo
n.

Corollary : Let p be a prime and gcd  a, p   1 . Then the congruence x k  a  mod p  has

a solution if and only if a p 1 / d  1 mod p  , where d  gcd  k, p  1 .

Example : Consider x3  4  mod13 .

Here d  gcd  3,  13   gcd  3,12   3 and so  13 / d  4 . Observe that

44  1 mod13 . Hence, this congruence has no solution.

Example : Solve x3  5  mod13 .

Solution : Here d  gcd  3, 13   4 and 54  1 mod13  .

Hence, x3  5  mod13 has a solution. Now the given congruence is equivalent to

3ind x  ind 5  mod12 

3ind x  9  mod12 

ind x  3  mod 4 
ind x  3, 7 or 11

And hence, x  7,8 or 11 mod13 .

Example : Solve x12  13  mod17  .

Solution. We have x12  13  mod17 


We know that 3 is a primitive root of 17 and therefore, this is equivalent to

12ind3x  ind 313  mod  17   or 12ind3x  4  mod16 

Clearly gcd 12,16   4 | 4 and hence 12ind3x  4  mod16  or 3  ind 3x  1 mod 4  has a
solution ind3x  3 . Thus x = 10. Thus solutions modulo 17 are 2, 6, 10, 14.

Number Theory | 104


If we take primitive root 5 instead of 3, we have ind3x  3 implies x = 6 and in this
case also solutions modulo 17 are 2, 6, 10, 14.
Note that gcd(12, 16) = 4 and hence there are 4 incongruent solutions modulo 17.

Ex. Solve 8x 5  10  mod17  .

Solution. We have 8x 5  10  mod17 


We know that 3 is a primitive toot of 17 and therefore, this is equivalent to

ind38  5  ind310  mod  17   or 10  5  ind3x  4  mod16 


Thus

5  ind3x  10  mod16   ind3x  2  mod16   ind 3x  2  x  9


Therefore, the solution is 9 modulo 17.
Ex. Solve 7 x  7  mod17  .

Solution. We have 7 x  7  mod17 


We know that 3 is a primitive root of 17 and therefore, this is equivalent to

x  ind37  ind37  mod  17   or x  1 mod16  .


Thus, the solution is 1 modulo 16.
Note that in above example solution is congruent to  17   16 but not 17 which is the case
in earlier examples.

Ex. Find the remainder when 324  513 is dividisble by 17.


Solution. We have to solve

324  513  x  mod17  .


Using theory of indices we can write

24  ind33  13  ind35  ind3x  mod  17   .


Thus we have

24 1  13  5  ind3x  mod16   ind 3x  9  mod16   ind 3x  9  x  12 .


Therefore, only solution is 12 modulo 17. Thus 12 is the remainder.

Number Theory | 105


Exercise :
1. Determine whether the two congruences x5  13  mod 23 and x17  15  mod 29 
are solvable.

2. For which values of b is the exponential congruence 9 x  b  mod13 solvable ?

3. Solve the congruence 7x3  3  mod11 .

4. Solve the congruence 3x 4  5  mod11 .

5. Determine the integers a 1  a  12  such that the congruence ax 4  b  mod13


has solution for b = 2, 5 and 6.



Number Theory | 106


Unit - 8
THE QUADRATIC RECIPROCITY LAW

8.1 QUADRATIC RESIDUE


The qudratic reciprocity law deals with solvability of quadratic congruences. Consider
the congruence.

ax 2  bx  c  0  mod p  ...... (1)

where p is prime and a  0  mod p  .

Since p is odd prime and p | a , we have gcd  4a, p   1 . Therefore, the quadratic
congruence in Eqn. (1) is equivalent to,

4a  ax 2  bx  c   0  mod p 

 4a 2x 2  4abx  4ac  0  mod p 


2
  2ax  b   b 2  4ac  mod p 

Now put 2ax  b  y and d  b 2  4ac , then we get

y 2  d  mod p  ........ (2)

If x  x0  mod p  is a solution of the quadratic congruence in Eqn. (1), then the


integer y  2ax0  b  mod p  is a solution of Eqn. (2). Conversely, if y  y0  mod p  is a
solution of quadratic congruence in Eqn. (2), then 2ax  y0  b  mod p  can be solved to
obtain solution to Eqn. (1).
Thus, the problem of finding a solution to the quadratic congruence in Eqn. (1) is
equivalent to that of finding a solution to linear congruence and a quadratic congruence of the
form.

x 2  a  mod p  . ..... (3)

Number Theory | 107


If p | a , then the quadratic congruence in Eqn. (3) has x  0  mod p  as its only

solution. To avoid trivialities, let us agree to assume hereafter that p | a . Thus whenever

x  x0 is a solution of x 2  a  mod p  , there is also a second solution x  p  x0 . Since


x0  p  x0  mod p  implies 2x0  0  mod p  or equivalently x0  0  mod p  which is
impossible as p | a . x0 and p  x0 are incongruent modulo p. By Lagranges theorem

x 2  a  mod p  admits two solutions x0 and p  x0 exhaust the incongruent solutions of

x 2  a  mod p  . Thus x 2  a  mod p  has exactly two solutions or no solutions.


e.g. consider the quadratic congruence

5x 2  6x  2  0  mod13
This is equivalent to,

4  5  5x 2  6x  2   0  mod13 
 100x 2  120x  36   4  0  mod13 
 100x  6   9  mod13
 y 2  9  mod13  ...... (4)
where y  10x  6 .

Clearly, (4) has solutions y  3,10  mod13 .


Next consider the linear equations

10x  6  3  mod13 and 10x  6  10  mod13


or equivalently

10x  9  mod13 and 10x  3  mod13


It can be seen that x  10  mod13 and x  12  mod13 are solutions of the above
linear congruences. Hence, x = 10, 12 are solutions of quadratic congruence modulo 13.

Definition : Let p be an odd prime and gcd  a, p   1 . If the quadratic congruence

x 2  a  mod p  has a solution then a is said to be quadratic residue of p otherwise a is


called quadratic non-residue of p.

Number Theory | 108


Note : If a  b  mod p  , then a is quadratic residue. If and only if b is a quadratic residue
of p.
Example : Consider the example with p = 13. We shall find out how many of the integers 1,
2, ..., 12 are quadiatic residues of 13. That is to find which of the congruences x 2  a  mod13
are solvable when a runs through {1, 2, ..., 12}.
Consider,

12  122  1
22  112  4
32  102  9

42  92  3

52  82  12

62  7 2  10 .
Thus 1, 3, 4, 9, 10, 12 are quadratic residues of 13 and 2, 5, 6, 7, 8, 11 are quadratic
non-residues.
Further, there are two pairs of consecutive quadratic residues namely 3, 4 and 9, 10.
1
In general for any odd prime p there are
4
 p  4   1
 p 1 / 2
 consecutive pairs.
1
For p = 3, there are 13  4   1131 / 2   2 pairs.
4
Theorem : (Euler’s Criterion)

Let p be an odd prime and gcd  a , p   1 . Then a is a quadratic residue of p if and

only if a p 1 / 2  1 mod p  .

Proof : Suppose that a is a quadratic residue of p, so that x 2  a  mod p  admits a solution,

call it x 1 . Since gcd  a , p   1 , gcd  x1 , p   1 . Then x12  a  mod p  , i.e.

a  x12  mod p  .Therefore, by Fermat’s theorem.

Number Theory | 109


 p 1
 p 1 /2
  p 1
a x12 2  x1  1 mod p  .

Conversely, suppose that a p 1 / 2  1 mod p  holds. Let r be a primitive root of p.

Then we know that r, r2, ....., rk are congruent modulo n to a1, a2, ....., a  n  a integer less
than n and relatively prime to n. Since gcd  a, n   1 , there is a positive integer k, 1  k  p  1
such that r k  a  mod p  . Then r k  a  mod p  for some integer k, with 1  k  p  1 .

Thus,

r k  p 1 / 2  a  p 1 / 2  1 mod p  . ...... (1)

Hence, order of r, that is, p – 1 must divide the exponent k  p  1 / 2 of r in (1). Thus
k has to be even. Let k = 2j. Then

 r j 2  r 2j  r k  a  mod p  .

Thus r j is a solution of quadratic congruence x 2  a  mod p  . Therefore, a is a


quadratic residue of p.

Note : Suppose that p is an odd prime and gcd  a, p   1 , then

a p1  1  0  mod p 

  a  p 1 / 2  1  a  p 1 / 2  1  0  mod p 

 a p 1 / 2  1 mod p  or a p 1 / 2  1 mod p  .

Note that if a satisfies both a p 1 / 2  1 mod p  and a p 1 / 2  1 mod p  then
we would have 1  1 mod p  which is absurd. Hence, exactly, one of the two holds.

Therefore, if a p 1 / 2  1 mod p  then we must have a p 1 / 2  1 mod p  . Therefore,

the integer a is quadratic non-residue of p iff a p 1 / 2  1 mod p  . Thus we have

Number Theory | 110


Corollary : Let p be an odd prime and gcd  a, p   1 . Then a is quadratic residue or non-
residue according to whether.

a p 1 / 2  1 mod p  or a p 1 / 2  1 mod p 


Note : We have seen that 3 is quadratic residue and 2 is non-residue of 13. Observe that
 / 2
2 131  26  64  12  1  mod13 
 /2 2 2
and 3 131  36   27   1  1 mod13

Example : Solve x 2  7x  10  0  mod11 .

Solution : Consider x 2  7x  10  0  mod11

 4x 2  28x  40  0  mod11
2
  2x  7   9  mod11 .
Now consider the congruence,

y 2  9  mod11 ..... (1)

where y  2x  7 .

Observe that y  3,8  mod11 are solution of Eqn. (1).

Now, we consider 2x  7  3  mod11 and 2x  7  8  mod11 . These are


equivalent to,

2x  4  mod11 and 2x  1 mod11


Consider 2x  4  mod11  x  2  mod11

 x  9  mod11
and 2x  1 mod11  6  2x   6 1  mod11  x  12x  6  mod11

 x  6  mod11 .

Thus x  6, 9  mod11 are the solutions of given quadratic congruence.

Number Theory | 111


8.2 THE LEGENDRE SYMBOL AND ITS PROPERTIES :
Definition : Let p be an odd prime and let gcd  a, p   1 . The Legendre symbol  a / p  is
defined by

1 If a is quadratic residue of p
a / p  
1 If a is quadratic non-residue of p .

a
Legendre symbol is also written as   or  a / p  . In the symbol  a / p  , a is
 p
called numerator and p is called denominator.
e.g. Let us take p = 13. Then
1/13   3/13   4 /13   9 /13  10 /13  12 /13  1
and  2 /13   5 /13   6 /13   7 /13   8 /13  11/13  1
Recall that 1, 3, 4, 9, 10, 12 are quadratic residues and 2, 5, 6, 7, 8, 11 are non-
residues.

Remark : For p | a, we have purposely left the symbol  a / p  undefined. Some authors
define  a / p   0 in case p | a. The advantage of this is that the number of solutions of

a
x 2  a  mod p  is given by 1   a / p  . Observe that if    1 then there are 2 solutions,
 p

a
if    1 , number of solutions is zero. However, if p | a, then x 2  a  mod p  becomes
 p
x 2  0  mod p  and in this case there is only one solution.

Theorem : Let p be an odd prime and let a and b be integers that are relatively prime to p.
Then the Legendre symbol has the following properties :

(a) If a  b  mod p  , then  a / p    b / p  ,

(b) a2 / p   1 ,

Number Theory | 112


(c)  a / p   a  p 1 / 2  mod p  ,
(d)  ab / p    a / p  b / p  ,
(e) 1/ p   1 and  1/ p    1 p 1 / 2 .
Proof : (a) If a  b  mod p  , then the congruences x 2  a  mod p  and x 2  b  mod p 

have exactly the same solutions if any at all. Thus x 2  a  mod p  and x 2  b  mod p  are
both solvable, or neither one has a solution, which is exactly  a / p    b / p  .

(b) Since a trivially satisfies x 2  a 2  mod p  we have  a 2 / p   1 .

(c) We know that a p 1 / 2  1 mod p  or a p 1 / 2  1 mod p  according as a is quadratic

residue or non-residue of p. Hence,  a / p   a  p 1 / 2  mod p  .

(d)  ab / p    ab  p 1 / 2  a  p 1 / 2b p 1 / 2   a / p  b / p  mod p  . Since Legendre


symbol assumes values 1 and –1 only, if  ab / p    a / p  b / p  , we would have
1  1 mod p  which is absurd because p > 2. Therefore, we must have
 ab / p    a / p  b / p  .
(e) Since  a 2 / p   1 , for a = 1, we have 1/ p   1 .

For the other part let a = –1 so that

 1/ p    1 p 1 / 2  mod p  ...... (1)

Since the quantities  1/ p  and  1 p1 / 2 are either 1 or – 1, Eqn. (1) implies that

 1/ p    1 p 1 / 2 .


Note :  ab2 / p    a / p   b 2 / p    a / p  .
Corollary : If p is an odd prime, then

1 if p  1 mod 4 
 1/ p   
1 if p  3  mod 4  .

Number Theory | 113


Note : In view of above corollary, we obtain, the quadratic congruence x 2  1 mod p 
has a solution iff p is of the form 4k + 1.

Example : Show that x 2  46  mod17  has no solution.

Solution : The given problem is equivalent to evaluating  46 /17  . We know

 46 /17    1/17  46 /17    46 /17    1/17    1171 / 2   18  1


Since 46  12  mod17  , we have

 46 /17   12 /17 

Thus 12 /17    3  22 /17    3 /17   2 2 /17    3 /17 

But  3/17   3171 / 2  38   81 2   4  2  1 mod17 

Therefore,  3/17   1 and consequently,  46 /17   1.

Thus x 2  46  mod17  has no solution.

Theorem : There are infinitely many primes of the form 4k + 1.


Proof : Suppose that there are finitely many such primes say p1, p2, ..., pn and consider,,
2
N   2p1, p2, ..., pn   1

Clearly, N is odd, so that there exists some odd prime p with p | N. To put it another
way,

 2p1, p2, ..., pn 2  1 mod p 


Thus  1/ p   1 . We know that  1/ p   1 only if p is of the form 4k + 1.

2
Hence, p must be one of p1, p2, ..., pn but then p | N   2p1, p2,..., pn   1
or p | 1. Which is absurd. Hence, the result.

Number Theory | 114


p 1
Theorem : If p is an odd prime, then  a / p  0 .
a 1

Hence, there are  p  1 / 2 quadratic residues and  p  1 / 2 quadratic non-residues


of p.

Proof : Let r be a primitive root of p. We know that the powers r, r 2,..., r p 1 are congruent
modulo p to 1, 2, ..., p – 1 in some order. That is r, r 2,..., r p 1 are just a permutation of the
integers 1, 2, ..., p – 1 modulo p. This for any a lying between 1 and p – 1, inclusive there is
a unique positive integer k 1  k  p  1 , such that a  r k  mod p  .

Since r is a primitive root of p, we have

r p 1  1  0  mod p    r  p 1 / 2  1  r  p 1 / 2  1  0  mod p 

 r  p 1 / 2  1 mod p  or r  p 1 / 2  1 mod p 

As r is primitive root of p, r  p 1 / 2  1 mod p  and hence

r  p 1 / 2  1 mod p  .

 p 1 / 2 k
 a / p  rk / p  r k    r  p 1 / 2    1  mod p  .
k
Thus

Therefore,  a / p    1 k   r k / p  are equal to 1 or – 1.

p 1 p 1
k
Hence,   a / p     1  0 .
a 1 k 1

and the theorem is proved.


Corollary : The quadratic residues of an odd prime p are congruent modulo p to the even
powers of the primitive root r of p; the quadratic non-residues are congruent to the odd
powers of r.
Proof : The result follows immediately from

 a / p    r k / p    1k  mod p  .

Number Theory | 115


Theorem (Gauss’ Lemma) :

Let p be an odd prime and let gcd  a, p   1 . If n denotes the number of integers in
the set.

  p 1 
S  a, 2a,3a,...,   a
  2  
whose remainders upon division by p exceed p/2, then

 a / p    1n .
Proof : Since gcd  a, p  = 1, we find that none of the  p  1 / 2 integers in S is congruent to
zero and no two are congruent to each other modulo p. Let r1, r2,..., rm be those remainders
upon division by p such that 0  ri  p / 2 and let s1, s2,..., sn be those remainders such that
p / 2  si  p .

Then m  n   p  1 / 2 and the integer..

r1, r2,...., rm, p  s1, p  s2,...., p  sn


are all positive and less than p / 2.
To prove that these integers are all distinct it suffices to show that no p  si is equal to
any rj. Assume on the contrary that,
p  si  r j

for some choice of i and j. Then there exist integers u and v, with 1  u , v   p  1 / 2
satisfying si  ua  mod p  and rj  va  mod p  . Hence,

 u  v  a  si  rj  p  0  mod p 

which says that u  v  0  mod p  . But the latter congruence can not take place
because 1  u  v  p  1 .

Number Theory | 116


Note that  p  1 / 2 numbers r1, r2,..., rm , p  s1, p  s2,..., p  sn are simply the
integers 1, 2, ...,  p  1 / 2 , not necessarily in order of appearance. Thus, their product is

 p 1 
 ! .
 2 

 p 1
Therefore,  !  r1...rm  p  s1  ... p  sn 
 2 

 r1...rm  s1  ... sn   mod p 

n
  1 r1...rms1...sn  mod p  .

 p 1 
But, we know that r1,....rm, s1,...., sn are congruent modulo p to a, 2a,....,  a,
 2 
in some order, so that

 p 1  n  p 1 
  !   1 a  2a.....   a  mod p 
 2   2 

 p 1 
  1 a p 1 / 2 
n
 ! mod p 
 2 

 p 1 
Since   ! is relatively prime to p, we obtain
 2 
n
1   1 a p 1 / 2  mod p 

n
 a p 1 / 2   1  mod p  .
By Euler’s criteria, we obtain,

 a / p   a  p 1 / 2   1n  mod p  .


Thus  a / p    1n .
Let us consider the case p = 13 and a = 5.

Number Theory | 117


Then  p  1 / 2  6 , so that s  5,10,15, 20, 25, 30 .
Modulo 13, the members of S are the same as the integers 5, 10, 2, 7, 12, 4. Three
of these are greater than 13/2. Hence, n = 3 and consequently,

 5 /13   13  1 .

Theorem : If p is an odd prime, then

1 if p  1 mod 8  or p  7  mod8 
2 / p  
1 if p  3  mod8  or p  5  mod8  .

Proof : By Gauss’ Lemma,  2 / p    1 n , where n is the number of integers in the set.

  p 1  
S  1 2, 2  2,3  2,...,    2
  2  

which upon division by p leave remainder greater that p/2. The members of S are all
less than p, so that it suffices to count the number that are greater than p / 2.

 p 1 
For 1  k    , we have 2k  p / 2 iff k  p / 4 . Therefore, there are  p / 4 
 2 
p 1  p 
integers in S less than p / 2; hence n     is the number of integers that are greater
2 4
than p / 2.
Now, we have four possibilities, for any odd prime has one of the forms 8k + 1,
8k + 3, 8k + 5 or 8k + 7. A simple calculation shows that,

 1
If p  8k  1 , then n  4k   2k    4k  2k  2k .
 4

 3
If p  8k  3 , then n   4k  1   2k    4k  1  2k  2k  1 .
 4

Number Theory | 118


 1
If p  8k  5 , then n   4k  2    2k  1    4k  2   2k  1  2k  1 .
 4

 3
If p  8k  7 , then n  4k  3   2k  1    4k  3   2k  1  2k  2 .
 4

Thus when p is of the form 8k  1 or 8k  7 , n is even and so  2 / p   1 and in case


p is of the form 8k  3 or 8k  5 , n is odd and so  2 / p   1 .

Corollary : If p is an odd prime, then


2
 2 / p    1(p 1) / 8
Proof : Suppose p is of the form 8k  1 , then

p2 1  8k  1 2  1 64k 2  16k
   8k 2  2k
8 8 8
Which is an even integer and hence

 1
 p 1 / 8
2
 1  2 / p

On the other hand, if p is of the form 8k  3 , then

p2 1  8k  32  1 64k 2  48k  8


   8k 2  6k  1
8 8 8

which is odd, so that  1 p 


2
1 / 8
 1   2 / p  .

Theorem : If p and 2p + 1 are both odd primes, then the integer  1 p1 / 2  2 is a primitive
root of 2p + 1.
Proof : For the sake of convenience, let us put q  2p  1 .

We distinguish the cases : p  1 mod 4  and p  3  mod 4 

Number Theory | 119


Case I : Let p  1 mod 4  . In this case  1 p1 / 2  2  2 . Because   q   q  1  2p ,
the order of 2 modulo q is one of the numbers 1, 2, p or 2p. We know

 2 / p   2 q 1 / 2  2 p  mod q 
But in the present setting, q  3  mod8  , hence, the Legendre symbol  2 / q   1 .
It follows that 2 p  1 mod q  and therefore 2 can not have order p modulo q. The order

of 2 being neither 1, 2 22  1 mod p   q13 which is not possible) nor p.

Therefore, order of 2 modulo q is 2p. Thus 2 is aprimitive root of q.

Case II : Let p  3  mod 4 . In this case  1 p1 / 2  2  2 and

 2  p   2 / q    1/ q  2 / q  mod q  .

Since q  7  mod8  , we have  1/ q   1 and  2 / q   1 .

Thus  2  p  1 mod q  . Arguing as in the first case, we conclude that – 2 is a


primitive root of q.

Note : An odd prime p such that 2p + 1 is also prime is called Germain prime after the French
number theorist Sophie Germain (1776 – 1831).

Theorem : There are infinitely many primes of the form 8k – 1.


Proof : Suppose on the contrary that there are only a finite numbers of primes of the form
2
8k – 1 namely p1, p2,...., pn and consider, N   4p1, p2,...., pn   2 .

There exist atleast one odd prime divisor p of N, so that

 4p1, p2,...., pn 2  2  mod p  .


In other words  2 / p   1 . Hence, p  1 mod8  .
If all the odd prime divisors of N were of the form 8k  1 , then N would be of the
form 8a + 1, this is clearly impossible because N is of the form 16a – 2.

Number Theory | 120


Thus, N must have a prime divisor q of the form 8k – 1. But q | N and
2
q /  4p1, p2,...., pn  leads to the contradiction that q | 2.

Lemma : If p is an odd prime and a is an odd integer, with gcd  a, p   1 , then

 p1/2
  ka / p 
k 1
 a / p    1 .

Proof : Consider the set of integers,

  p 1  
S  a, 2a,...,   a .
  2  
By division algorithm, we have

ka  qk p  tk 1  tk  p  1 .

ka tk  ka   p 1 
Then  qk      qk for 1  k   .
p p  p  2 
Thus we can write

 ka 
ka    p  tk . ..... (1)
 p

If tk  p / 2 , then it is one of r1, r2,..., rm and if tk  p / 2 , then it is one of the integers


s1,..., sn .

Taking the sum of  p  1 / 2 equations in (1),

 p 1 / 2  p 1 / 2  ka  m n
 ka     p   rk   sk . ...... (2)
k 1 k 1  p k 1 k 1

We know that  p  1 / 2 numbers,

Number Theory | 121


r1,..., rm, p  s1,..., p  sn

are just rearrangement of the integers 1, 2, ...,  p  1 / 2 .


Hence,

 p 1 / 2 m n m n
 k   rk    p  sk   pn  rk   sk . ...... (3)
k 1 k 1 k 1 k 1 k 1

Subtracting Eqn. (3) from Eqn. (2), we obtain,

 p 1 / 2   p 1 / 2  ka   n
 a  1  k  p      n   2 sk . ...... (4)
k 1  k 1  p   k 1
Since both a and p are odd integers, we have,

p  a  1 mod 2 
and therefore Eqn. (4) can be written as,
 p 1 / 2   p 1 / 2  ka  
0  k  1       n   mod 2 
k 1  k 1  p  
 p 1 / 2  ka 
n     mod 2  .
k 1 p
Thus by Gauss’ lemma,

 p 1/2  ka 
  
n k 1  p 
 a / p    1   1 .

This proves the Lemma.

 p 1 
Example : Let us consider p = 13 and a = 5. Here    6.
 2 

 ka 
Therefore, it is necessary to consider   for k = 1, 2, ....., 6. Thus,
 p

Number Theory | 122


 5  10  15   20   25   30 
      0 ,         1,    2 .
13  13   13   13   13   13 
Therefore,

 5 /13   10 0111 2   15  1 .

QUADRATIC RECIPROCITY LAW :


If p and q are distinct odd primes, then,

 p 1  q 1 
  1 2   2  .

 p / q  q / p 
Proof : Consider the rectangle in the xy co-ordinate plane whose vertices are (0, 0), ( p/2, 0),
(0, q/2), and ( p/2, q/2 ).
Let R denote the region within this rectangle, not including any of the bounding lines.
The general plan of attack is to count the number of lattice points, that is, the points whose co-
ordinates are integers, inside R in two different ways. Because p and q are both odd, the
 p 1   q 1 
lattice points in R consist of all points (n, m), where 1  n    and 1  m   .
 2   2 

 p  1  q  1 
Clearly, the number of such points is   .
 2  2 

q
Consider the diagonal D from (0, 0) to (p/2, q/2) which has the equation y    x ,
 p
or equivalently py  qx .

Because gcd  p, q   1 , none of the lattice points inside R will lie on D, for
p / qx  p / x and q / py  q / y and clearly there exist no such x and y such that
 x, y   R . Suppose that T1 denotes the portion of R that is below the diagonal D, and T2
denote the portion above. By what we have just seen, it suffices to count the lattice points
inside each of these triangles.

Number Theory | 123


kq  kq 
The number of integers in the interval 0  y  is equal to   . Thus for
p  p

 p 1   kq 
1 k    , there are precisely  p  lattice points in T1, directly above (k, 0) and
 2   

 kq 
below D; in other words, lying on the vertical line segment from (k, 0) to  k,  . It follows
 p
 p 1 
 
 2   kq 
that the total number of lattice points contained in T1 is   .
k 1  p

 q  p q
 0,   , 
 2  2 2

2
1

0 1 2 3 4 p 
 , 0
2 
A similar calculation, with the roles of p and q interchanged, shows that the number of
lattice points within T2 is
 q 1 
 
 2  jp 
  .
j 1 q
This accounts for all of the lattice points inside R, so that
 p 1   q 1 
   
 p  1  q  1   2   kq   2  jp 
        .
 2  2  k 1  p j 1 q

Number Theory | 124


Now by Gauss’ Lemma, we obtain,

 q 1   p 1 
   
 2   jp   2   kq 
     
 p  q  j 1  q  k 1  p 
     1   1
 q  p 
 q 1   p 1 
   
 2   jp   2   kq 
     
j 1  q  k 1  p 
  1

 p 1  q 1 
  
 2  2 
  1 .
This proves Quadratic Reciprocity Law.

Corollary 1 : If p and q are distinct odd primes then,

 p  q  1 if p  1 mod 4  or q  1 mod 4 
    
 q  p  1 if p  q  3  mod 4  .

 p  1  q  1 
Proof : Note that    is even if and only if at least one of p and q is of the form
 2  2 

 p  1  q  1 
4k + 1 and if both are of the form 4k + 3, the product    is odd.
 2  2 
Corollary 2 : If p and q are odd primes, then,

 q 
  if p  1 mod 4  or q  1 mod 4 
 p   p 
 
q  q
 
  p  if p  q  1 mod 4 .
  

2 2
 p q
Proof : Note that    1    so that the result follows from above corollary..
q  p

Number Theory | 125


Note : Let p be an odd prime and a  1 to be an integer not divisible by p. Suppose that a
has the factorization.

Therefore, a  2k0 p1 k1 p2 k2...p r kr

where pi are distinct primes. Because the legendre symbol is multiplicative.


k k k
 a   1   2  0  p1  1  pr  r
          ...   .
 p   p  p   p   p 

a  1 2
To calculate   , we have only to calculate each of the symbols    ,   and
 p  p  p

 pi   1 2
  . The values of    and   were discussed earlier, so that one stumbling block is
 p  p  p

 pi 
  , where pi and p are distinct odd primes, this is where the Quadratic Reciprocity Law
 p

 pi 
enters. Corollary 2 allows us to replace   by a new Legendre symbol having a smaller
 p
denominator. Through continued inversion and division, the computation can be reduced to
 1 1  2
that of the known quantities    ,  ,  .
 q q q

 29 
Consider the Legendre symbol   . Here 29  1 mod 4  and 53  1 mod 4  ,
 53 
we see that,

 29   53   24   2  3  4 
            
 53   29   29   29  29  29 

 2  3 
   
 29  29 

Number Theory | 126


 2 
Since 29  5  mod8  ,    1 . And
 29 

 3   29   2 
         1 (Since 3  3  mod8  )
 29   3   3 

 29 
Thus,     1 1  1.
 53 

Theorem 1 : If p  3 is an odd prime, then

 3  1 if p  1 mod12 
 
 p  1 if p  5  mod12  .

Proof : Let p  3 be an odd prime. Since 3  3  mod 4  we have,

 p 
 3    if p  1 mod 4 
 3 
 
 p   p
 
  3  if p  1 mod 4 .

Now p  1 mod 3 or p  2  mod 3 , therefore

 p  1 if p  1 mod 3
 
 3  1 if p  2  mod 3 .

3
Thus    1 if and only if
 p

p  1 mod 4  and p  1 mod 3 or p  3  mod 4  and p  2  mod 3 .

Thus p  1 mod12  . Hence, the result follows.

Number Theory | 127


QUADRATIC CONGRUENCES WITH COMPOSITE MODULI
In this section we shall be dealing with composite moduli. We begin with,

Theorem : If p is an odd prime and gcd  a, p   1 , then the congruence x 2  a  mod p n  ,


a
n 1 has a solution if and only if    1.
 p
Proof : Suppose x 2  a  mod p n  has a solution, then so does x 2  a  mod p  , in fact the

a
same solution, thus    1 .
 p
a
Conversely, suppose that    1 . We shall use induction to prove the result. Since
 p
a
   1 , x 2  a  mod p  has a solution, so that result holds for n = 1. Let the result hold for
 p
n  k  1 , that is, x 2  a  mod p k  has a solution x0 . Then

x02  a  mod p k  .
So that x02  a  bp k for some integer b.

Since gcd  2x0, p   1 , the congruence 2x0 y  b  mod p  has a unique solution
x0 modulo p. Consider,,

x1  x0  y0 p k
Then x12  x02  2x0 y0 p k  y02 p 2k
 a   b  2x0 y0  p k  y02 p 2k .

In view of 2x0 y  b  mod p  , p | 2x0 y0  b . Thus, we obtain

x12  a  mod p k 1  .

Therefore, x 2  a  mod p k 1  has a solution for n  k  1 .

Hence, by induction the result holds for any n.


We shall now state and prove some results for p = 2.

Number Theory | 128


Theorem : Let a be an odd integer. Then we have the following.
a) x 2  a  mod 2  always has a solution.

b) x 2  a  mod 4  has a solution if and only if a  1 mod 4  .

c) x 2  a  mod 2n  , for n  3 , has a solution if and only if a  1 mod 8  .


Proof :
a) The result is t rivial for any odd x  2k  1 and x  2l  1 ,
x2  a  4k 2  4k  4l 2  4l is always divisible by 2.
b) Suppose x 2  a  mod 4  , then as square of an odd integer is of the form 4k + 1, a
must be of the same form, that is a  1 mod 4  .

Conversely, suppose a  1 mod 4  then there are two solutions modulo 4, namely,,
x = 1 and x = 3.
c) We know that square of an odd integer is congruent to 1 modulo 8, a must be of the
form 8k + 1. Conversely, suppose a  1 mod 8  , we shall use induction on n. Let n = 3, then
1, 3, 5, 7 are solutions of x 2  1 mod8  . Let the result hold for n  k  1 , then
2 k
x 2  a  mod 2k  admits a solution x0 , that is, x0  a  b2 for some integers b. Since a is
odd, so does x0 . Therefore, x0 y  b  mod 2  admits a unique solution y0 .

Consider x1  x0  y02k 1 and

x12  x02  2x0 y02k 1  y0222k  2

 a  b  2k  x0 y02k  y0222k  2
 a   b  x0 y0  2k  y02  22k  2 .

Since 2 / x0 y0  b we have

x12  a  mod 2 k 1  .
Note that 2k  2  k  1  k  3  k  1 .
Thus the result holds for n  k  1 . Therefore, by principle of induction, the result
holds for any n.

Number Theory | 129


Theorem : Let n  2k0 p1 k1 p 2 k2.....pr kr be the prime factorization of n > 1 and let

gcd  a, n   1 .Then x 2  a  mod n  is solvable if and only if

a
a)    1 for i = 1, 2, ...., r
 pi 

b) a  1 mod 4  if 4 | n , but 8 | n ; a  1 mod 8  if 8 | n.

Proof : Observe that the problem of solving quadratic congruence x 2  a  mod n  is equivalent
to that of solving system of congruences.

x 2  a  mod 2k0 

x 2  a mod p1 k1
x2  a  mod p 
2
k2



x 2  a mod pr kr 
In view of last two results, the result follows.

Example : Show that 7 and 18 are the only incongruent solution of x 2  1 mod 52  .

Solution : Consider x 2  1 mod 5  . Clearly, x0  2 is a solution of this quadratic


congruence. Observe that x02  4  1  1 5 so that b = 1 and consider the congruence
2x0 y  b  mod 5  , that is,

2  2  y  1 mod 5   4y  1 mod 5 

Clearly, unique solution of this congruence is y0  1 .

Thus, x1  x0  y0 p  2  1  5  7 is a solution of x 2  1 mod 52  .

Moreover, 7  18  mod 5 2  is the only other solution.

Example 2 : Using above example solve x 2  1 mod 53  .

Solution : We know from above example that x0  7 is a solution of x 2  1 mod 52  .

With this we proceed to next step x02  a  b  52  49   1  2  52 so that b = 2. Now

Number Theory | 130


consider 2x0 y  b  mod 52  , that is, 14y  2  mod 52  . Here y0  7 is a solution of

14y  2  mod 52  . Thus x1  x0  y0 p  7  7  5  182 .


k 2

Thus 57  182  mod125 and 68  182  mod125 are solutions of


x 2  1 mod125  .

In fact 57 and 68 are the only incongruent solutions of x 2  1 mod125  .


EXERCISE :
1. Solve x 2  7  mod 33 

2. Solve x 2  31 mod114 

3. Solve x 2  1 mod 25 

4. Solve x 2  5x  6  0  mod 53 
Answer :

1. x  13,14  mod 33 

2. x  5008,9633  mod114 

3 1,  1, 1  2 4,  1  2 4

4. x  122,123  mod 53 



REFERENCES:
1. David M. Burton, Elementary Number Theory, Tata McGraw Hill Education Private
Limites, New Delhi, Sixth Edition(2011).
2. Ajay Kr Chaudhary, Introduction to Number Theory, New Central Book Agency (P)
Ltd. Delhi, Kolkata, Pune, Ernakulam.

Number Theory | 131

You might also like

pFad - Phonifier reborn

Pfad - The Proxy pFad of © 2024 Garber Painting. All rights reserved.

Note: This service is not intended for secure transactions such as banking, social media, email, or purchasing. Use at your own risk. We assume no liability whatsoever for broken pages.


Alternative Proxies:

Alternative Proxy

pFad Proxy

pFad v3 Proxy

pFad v4 Proxy