M. Sc. II Maths. Number Theory All
M. Sc. II Maths. Number Theory All
Number Theory
(Mathematics)
For
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 , 0r 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 , 0r 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
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 .
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 )
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 .
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 .
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 .
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 .
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 .
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 .
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
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
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 11
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 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.
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 .
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.
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 113
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)
Here gcd 1, 4 1 and 1|44 Hence, Equation (3) has a solution. Now
1 4 1 1 3
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 .
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
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.
p | ak for some 1 k m 1
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 .
Claim : p1 is prime.
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 .
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.
n 4 4 n 4 4n 2 4 4n 2
2 2
n 2 2 2n
n 2 2 2n n 2 2 2n ,
Consider
P = p 1 p 2 ... p n + 1
Number Theory | 22
Thus p | P - p 1 p 2 ...... p n = 1 . Therefore, p | 1 which is absurd.
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 .
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 .
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
p n p 1 p 2 ... p n -1 - 1 n 3 .
n1
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 n2
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
n1
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
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
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?
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 .
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.
Number Theory | 28
Unit – III
CONGRUENCES
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.
nq1 r b qn
b q1 q n r .
Number Theory | 29
Thus, a b q1 q2 n a b mod n .
a) a a mod n .
Proof. a) a a mod n
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 .
n | a b and n | b c
n | a b b c
n | a c
Number Theory | 30
a c mod n .
n | a b and n | c d
a c b d a b c d
nr ns
nr s .
Therefore, n | a c b d
a c b d mod n
a c b d mod n .
ac bd n rc bs
n | ac bd ac bd mod n
ac bc mod n .
f) Suppose a b mod n n | a b .
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 .
Thus,
99
Ex.2. Find last two digits of the number 9 .
9
Solution. We know 9 1 mod10 , therefore 99 1 1 9 mod10 .
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 .
r a b sk s | a b
a b mod s
Number Theory | 32
n
a b mod .
d
Hence the result.
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
Ex. 4. Give an example to show that a 2 b 2 mod n need not imply a b mod 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 ' .
23 1 mod 7
16
248 23 116 mod 7
2 48 1 mod 7
Thus 250 4 mod 7 , that is, remainder when 250 is divided by 7is 4.
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 21239 4 29 24 (1)123 16 (1) 7 7 2(mod 9) .
4
Hence, 24444 21111 24 7(mod 9) .
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.
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 am1b m1 am 2b m 2 a1b a0 where the coefficients ak can
take on b different values 0,1, 2,, b 1 .
N q1b a0 , 0 a0 b .
q1 q2 b a1 , 0 a1 b .
Uniqueness:
Suppose that, N has two distinct representations as follows
0 dm bm dm 1bm1 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
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
and
P(1) a0 a1 am 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 am110m1 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 .
and
P(1) a0 a1 (1)m am T .
In view of this result, we have an integer N am10m am110m1 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 am1 x m1 a1 x a0 . Let N am 9m am1 9m1 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?
Exercises 3.1
4. Working with modulo 9 or 11m find the missing digit in the calculation below
a) 51840 273581 1418243 x 040
(Ans. a) 9, b) 4)
3.3. Linear congruences:
Definition. An equation of the form ax b(mod n) is called linear congruence.
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 .
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 ) .
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 .
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,
we obtain the relation between r and s given by 4(15 51t ) 51(3 4s) 9 r t 1 0.
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 .
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 .
Hence,
x a1 N1 x1 a2 N 2 x2 ar N r xr ak N k xk (mod nk ) .
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) .
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,
Number Theory | 41
N2 x 1 mod5 21x 1 mod5
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.
Solution. Note that 276 3.4.23 and given linear congruence is equivalent to
Now
3k 1 mod 4 or
k 9k 3 mod 4
Thus, x 3k 3 3 4 j 9 12 j . (6)
Number Theory | 42
204 j 144 mod 23
3 j 6 mod 23
j 2 mod23
ax by c mod n .
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
1 5 2 3 gives us
35x 15 y 50 mod16
6 x 15 y 27 mod16
13x 7 mod16
x 3 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
Number Theory | 45
Unit-4
Fermat’s Theorem
a p1 1 mod p .
where 1 r s 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 p1 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 p1 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 .
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
Thus
So that
Thus,
Now,
3
221 27 113 (mod117) .
Therefore,
Number Theory | 47
113 12111 4.11(mod117)
Thus
Hence,
Thus,
2117 44 mod117
2117 2 mod117
a pq a mod pq .
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.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 .
Since p 1| q 1 , (a p 1 1) | (a q 1 1) .
Hence, 39 383 1 3 3(mod10) . Further, 3100 3 (39 )11 3 311 34 38 11 1(mod10) .
p∤a
p 1
However a 1 mod p may hold for non-prime p also.
210 1 mod11 .
So that
Therefore,
2341 2 mod341
2340 1 mod341
Number Theory | 49
n1
Thus a 1 mod n holds for non-prime n. In other words, n | an1 1.
In particular n | 2n1 1 .
Such a composite integer ‘n’ is called Pseudo prime.
n1
Note. a 1 mod n need not imply n is prime.
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
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 .
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 .
Thus pi | a pi 1 1 .
Number Theory | 51
Thus pi | an-1 -1 for all i 1,2,, r .
Therefore, n p1 p2 pn | a n1 1 .
Then gcd a, p 1.
Consider the linear congruence ax 1 mod p . Since gcd a, p 1 the linear congruence
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 .
Hence,
2 3( p 2) 1(mod p)
p 2 ! 1 mod p
2.7 1 mod13
3.9 1 mod13
4.10 1 mod13
5.8 1 mod13
6.11 1 mod13
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
Number Theory | 53
p 1 p 1
1 a p 1 a 2 2 1 2 mod p .
Conversely,
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 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 .
1 26!27.28 mod29
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
421 283 .
Ex.10. Factors 23449
Solution. Observe that 153 2 23449 154 2 .
Consider
Thus
155 2 23449 24 2
23449 155 2 24 2
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.
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
105 2 10541 22 2
10541 105 2 22 2
= 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
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 .
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 ,
f (d ) f ( d ) f ( d ) f ( d ) .
d |n
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
Then
Number Theory | 60
Theorem. If n p1k1 p2 k2 pr kr is the prime factorization of n 1 , then
Further,
p k1 1 1 p2k2 1 1 prkr 1 1
Thus ( n) 1 .
p1 1 p2 1 pr 1
23 1 33 1 52 1
(180) (2 1)(2 1)(1 1) 18 and (180) 546 .
2 1 3 1 5 1
2 ( n)
We have , n ( n) d n 2
d .
d |n d |n
Note that , (20) (5) (4) but (20) (10) (2) and (20) (5) (4) but
(20) (10) (2) .
f mn
. f m f n whenever gcd m, n 1.
Number Theory | 61
Proof : Let m, n be integers such that gcd m, n 1. If either m = 1 or n = 1 then as
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 .
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
F mn f d1 f d2 .
d1|m d2 |n
Thus F mn F m F n .
Proof. We know f (n) 1 and f (n) n are multiplicative. Hence, (n) 1 and
d |n
1, if =1
( )= 0, if | for some prime p
(−1) if = ... where are all distinct
Number Theory | 63
Proof. Let a, b be two relatively prime positive integers.
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.
1, if n 1
d 0, if n 1
d |n
where d runs through the positive divisors of n.
(d ) (1) ( p) ( p ) ( p
d |n
2 K
)
1 1 0 0 ..... 0
0.
Consider,
Since F ( p k ) ( d ) 0 .
d | pk
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
( )= ( ) = ( )
/ /
( ) 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 cn
n n
Hence, f n d F F d
d |n d d |n d
n n
Hence, 1 ( d ) and n ( d ) .
d |n d d |n d
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.
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 .
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
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!.
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.
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
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)
Number Theory | 70
N N
N
Corollary. If N is a positive integer then n
n1 k 1 k
Similarly, we obtain
N N
N
Corollary. If N is a positive integer then n k .
n1 k 1 k
6 3 2 1 11
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
For n 1, let n denote the number of positive integers less than or equal to n and
relatively prime to n.
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
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 .
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
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
p1k1 ...... ps ks ps 1ks1 (Since is multiplicative)
p1k1 p1k1 1 ...... ps ks ps ks 1 p s 1
k s 1
ps 1ks1 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
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.
Number Theory | 74
Since p is odd prime, p – 1 is even,so n is even.
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.
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) .
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 .
Thus, aa1 aa2 aa ( n) a '1 a '2 a ' ( n ) (mod n), that is, (aa1 )...(aa ( n) )
a1a2 a ( n ) (mod n) .
Number Theory | 75
n
a 1 mod n .
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 .
Hence, the last two digits in the decimal representation of 3 2 56 are 21.
Solution. Observe that 1729 7 13 19 . Let a be an integer such that, gcd(a,1729) 1 ,then
Ex.3. If m and n are relatively prime positive integers, then m (n) + n (m) 1 (modmn)
q1 p1
Hence deduce, p q 1 mod pq where p and q are distinct primes.
Number Theory | 76
q p
p q 1 mod pq .
q1 p1
That is, p q 1 mod pq .
Exercises
1. Use Euler’s theorem to establish the following
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,
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
n
n d F
d |n d
n
d
d |n d
d
n
d |n d
d
n .
d |n d
d 2 5 10
10 10 1
d |n d 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
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.
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 .
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 .
i j
Thus, a a mod n .
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
h k1 h1
Consider, a a hk1 a ( h1d )( k / d ) a h1k a k 1h1 1(mod n) .
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
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
n1
22 1 2 2 n
1
n
22 1 22 1 n
Fn 22 1
n
n 1
22 1 mod Fn
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.
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
Therefore, n | 2n 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
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.
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
Thus, r 0(mod p) .
Hence, f ( x) ( x a) g ( x)(mod p) .
x p 1 1 x dk 1
k
xd 1
xd 1 xd
k 1
..... 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 .
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.
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)
d d holds trivially.
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)
other words a k has order d modulo p if and only if gcd k, d 1 . Thus d d that is,
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 .
Ex.1. If p is a prime of the form 4k + 1, then the quadratic congruence x 2 1(mod p) ,admits
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
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 ) .
has exactly p – 2 incongruent solutions and they are the integers 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.
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,
57 55 52 20 2 17 mod 23 , 59 57 5 2 17 2 11 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
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 ,
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 111 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 p1 /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 :
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 .
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)) .
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) .
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.
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 ) .
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 ) .
p 2 must be p 2 p p 1 .
Proof. We shall prove this result by induction on k. For k = 2, the result holds trivially ,
n2
Suppose that the result holds for k = n, i. e., r p ( p 1)
1(mod p n ) .
r
p n1 1(mod p n 1 ) r p n2
( p 1)
1(mod p n 1 ) 1 ap n 1 ,
n2
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
n1
( p 1)
rp n2
( 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 ) .
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 p1 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 p1 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 911 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 :
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 :
Exercise :
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 .
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.
The theory of indices can be used to solve certain types of congruences. Consider the
binomial congruence.
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
n
ind a ind 1 mod n .
d
n
ind a 0 mod n
d
ind a 0 mod d
d | ind a
Corollary : Let p be a prime and gcd a, p 1 . Then the congruence x k a mod p has
3ind x 9 mod12
ind x 3 mod 4
ind x 3, 7 or 11
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.
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
solution. To avoid trivialities, let us agree to assume hereafter that p | a . Thus whenever
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 .
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 1131 / 2 2 pairs.
4
Theorem : (Euler’s Criterion)
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,
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 .
a p1 1 0 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
4x 2 28x 40 0 mod11
2
2x 7 9 mod11 .
Now consider the congruence,
where y 2x 7 .
x 9 mod11
and 2x 1 mod11 6 2x 6 1 mod11 x 12x 6 mod11
x 6 mod11 .
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 :
(b) a2 / p 1 ,
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 .
(c) We know that a p 1 / 2 1 mod p or a p 1 / 2 1 mod p according as a is quadratic
Since the quantities 1/ p and 1 p1 / 2 are either 1 or – 1, Eqn. (1) implies that
1 if p 1 mod 4
1/ p
1 if p 3 mod 4 .
Clearly, N is odd, so that there exists some odd prime p with p | N. To put it another
way,
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.
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 .
p 1 / 2 k
a / p rk / p r k r p 1 / 2 1 mod p .
k
Thus
p 1 p 1
k
Hence, a / p 1 0 .
a 1 k 1
a / p r k / p 1k mod p .
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 1n .
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 .
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 .
p 1
! .
2
p 1
Therefore, ! r1...rm p s1 ... p sn
2
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,
5 /13 13 1 .
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
3
If p 8k 7 , then n 4k 3 2k 1 4k 3 2k 1 2k 2 .
4
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
Theorem : If p and 2p + 1 are both odd primes, then the integer 1 p1 / 2 2 is a primitive
root of 2p + 1.
Proof : For the sake of convenience, let us put q 2p 1 .
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
2 p 2 / q 1/ q 2 / q mod 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).
p1/2
ka / p
k 1
a / p 1 .
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
p 1 / 2 p 1 / 2 ka m n
ka p rk sk . ...... (2)
k 1 k 1 p k 1 k 1
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
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 .
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
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.
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
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.
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
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
3 29 2
1 (Since 3 3 mod8 )
29 3 3
29
Thus, 1 1 1.
53
3 1 if p 1 mod12
p 1 if p 5 mod12 .
p
3 if p 1 mod 4
3
p p
3 if p 1 mod 4 .
p 1 if p 1 mod 3
3 1 if p 2 mod 3 .
3
Thus 1 if and only if
p
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 .
x12 a mod p k 1 .
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 .
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.
a
a) 1 for i = 1, 2, ...., r
pi
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 .
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.