0% found this document useful (0 votes)
89 views31 pages

Number Theory by Naresh Vasant Afre 08 April 2022

1) The document defines divisibility and properties of divisibility such as if a divides b then a divides -b. It also covers the division algorithm, greatest common divisor (gcd), and relatively prime numbers. 2) Examples are provided to illustrate key concepts like finding the gcd using the Euclidean algorithm and solving linear Diophantine equations of the form ax + by = c. 3) Theorems are stated about the gcd, such as the existence of integers x and y such that ax + by = gcd(a,b), and that the gcd(a,b) = gcd(b,r) if a = bq + r.

Uploaded by

Swapnil Oza
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
0% found this document useful (0 votes)
89 views31 pages

Number Theory by Naresh Vasant Afre 08 April 2022

1) The document defines divisibility and properties of divisibility such as if a divides b then a divides -b. It also covers the division algorithm, greatest common divisor (gcd), and relatively prime numbers. 2) Examples are provided to illustrate key concepts like finding the gcd using the Euclidean algorithm and solving linear Diophantine equations of the form ax + by = c. 3) Theorems are stated about the gcd, such as the existence of integers x and y such that ax + by = gcd(a,b), and that the gcd(a,b) = gcd(b,r) if a = bq + r.

Uploaded by

Swapnil Oza
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/ 31

Mathematics is the Queen of the Sciences and Number Theory is the Queen of Mathematics

:-Carl Friedrich Gauss

D IVISIBILITY

Definition:
If 𝑎 and 𝑏 are integers with 𝑎 ≠ 0, we say that 𝑎 divides 𝑏, denoted as 𝑎|𝑏, if there exists an
integer 𝑘 such that 𝑏 = 𝑘𝑎. (that is 𝑏 is an integral multiple of 𝑎.)
If 𝑎 does not divide 𝑏 then we denote it as 𝑎 ∤ 𝑏.
For example:
1. 4|12, as 12 = 3 × 4
2. 5 ∤ 19, since 19 is not an integral multiple of 5.
Divisibility properties:
1. If 𝑎 is any non-zero integer then
i. 𝑎|0,
ii. 1|𝑎 ,
iii. 𝑎|𝑎.
Proof:
i. We know that 0 = 0 × 𝑎 for any 𝑎, so 0 is an integral multiple of 𝑎 for any 𝑎,
Therefore 𝑎|0 for any non-zero 𝑎.
ii. As 𝑎 = 𝑎 × 1, so 𝑎 is an integral multiple of 1, hence 1|𝑎.
iii. As 𝑎 = 1 × 𝑎, so 𝑎 is an integral multiple of 𝑎, hence 𝑎|𝑎.

2. If 𝑎|𝑏 then 𝑎|(−𝑏).


Proof:
As 𝑎|𝑏, so 𝑏 = 𝑘𝑎 for some 𝑘 ∈ ℤ. This implies that −𝑏 = (−𝑘)𝑎, i.e., −𝑏 is an
integral multiple of 𝑎. Hence 𝑎|(−𝑏).

3. If 𝑎|𝑏 and 𝑏|𝑐 then 𝑎|𝑐.


Proof:
As 𝑎|𝑏 and 𝑏|𝑐, so 𝑏 = 𝑘1 𝑎 and 𝑐 = 𝑘2 𝑏 for some integers 𝑘1 and 𝑘2 .
So, 𝑐 = 𝑘2 (𝑘1 𝑎) = 𝑘3 𝑎. This means that 𝑐 is an integral multiple of 𝑎.
Therefore , 𝑎|𝑐.

4. If 𝑎|𝑏, 𝑎|𝑐 then 𝑎|𝑚𝑏 + 𝑛𝑐 for any integers 𝑚, 𝑛.


Proof:
As it is given that 𝑎|𝑏 and 𝑎|𝑐, so 𝑏 = 𝑘1 𝑎 and 𝑐 = 𝑘2 𝑎 for some integers 𝑘1 , 𝑘2 .
Let 𝑚, 𝑛 be any two arbitrary integers then
𝑚𝑏 + 𝑛𝑐 = 𝑚𝑘1 𝑎 + 𝑛𝑘2 𝑎 = (𝑚𝑘1 + 𝑛𝑘2 )𝑎 = 𝑘3 𝑎.

Page 1 of 31
This means that 𝑚𝑏 + 𝑛𝑐 is an integral multiple of 𝑎.
Hence 𝑎|𝑚𝑏 + 𝑛𝑐. As 𝑚 and 𝑛 where arbitrarily chosen.
Therefore, 𝑎|𝑚𝑏 + 𝑛𝑐, for any integers 𝑚, 𝑛.
5. If 𝑎|𝑏 and 𝑐|𝑑, then 𝑎𝑐|𝑏𝑑.
Proof:
As it is given that 𝑎|𝑏 and 𝑐|𝑑, so 𝑏 = 𝑘1 𝑎 and 𝑑 = 𝑘2 𝑐 for some integers 𝑘1 , 𝑘2 . So
𝑏𝑑 = 𝑘1 𝑘2 𝑎𝑐. This means that 𝑏𝑑 is an integral multiple of 𝑎𝑐. Hence 𝑎𝑐|𝑏𝑑.

Theorem (Division algorithm):


Let 𝑎, 𝑏 be two integers with 𝑏 > 0. Then, there exists unique integers 𝑞 and r, such
that 𝑎 = 𝑏𝑞 + 𝑟, with 0 ≤ 𝑟 < 𝑏.
The integers 𝑞 and 𝑟 are called, respectively, the quotient and remainder in the
division of 𝑎 by 𝑏.

For example:
1. If 𝑎 = 35 and 𝑏 = 8 then 35 = 8 × 4 + 3, so 𝑞 = 4 and 𝑟 = 3.
2. If 𝑎 = 35 and 𝑏 = 7 then 35 = 7 × 5 + 0, so 𝑞 = 5 and 𝑟 = 0.
3. If 𝑎 = −54 and 𝑏 = 5 then −54 = 5 × (−11) + 1, so 𝑞 = −11 and 𝑟 = 1.

Greatest common divisor:


Let 𝑎 and 𝑏 be given integers, with at least one of them different from zero. The
greatest common divisor of 𝑎 and 𝑏, denoted by gcd(𝑎, 𝑏), is the positive integer 𝑑
satisfying
(1) 𝑑|𝑎 and 𝑑|𝑏,
(2) if 𝑐|𝑎 and 𝑐|𝑏 then 𝑐 ≤ 𝑑.
Notation: We sometimes write gcd(𝑎, 𝑏) simply as (𝑎, 𝑏).
For example:
The positive divisors of −15 are 1, 3, 5, 15, while those of 20 are 1, 2, 5, 10, 20; hence,
the positive common divisors of −15 and 20 are 1, 5. Since 5 is the largest of these
integers, so gcd(−15, 20) = 5.
Similarly,
gcd(−12, 30) = 6, gcd(−7, 7) = 7, gcd(−11, 0) = 11.

Page 2 of 31
Theorem: Given integers 𝑎 and 𝑏, not both of which are zero, there exist integers 𝑥 and
𝑦 such that
𝑎𝑥 + 𝑏𝑦 = gcd(𝑎, 𝑏).
For example:
1. The gcd(−15, 20) = 5. So 𝑥 = 1 and 𝑦 = 1 works, since −15(1) + 20(1) = 5.
2. The gcd(−12, 30) = 6. So 𝑥 = 2 and 𝑦 = 1 works, since −12(2) + 30(1) = 6.
3. The gcd(−11, 0) = 11. So 𝑥 = −1 and any value of 𝑦 works.
4. The gcd(11, 7) = 1. So 𝑥 = 2 and 𝑦 = −3 works, since 11(2) + 7(−3) = 1.

Relatively Prime OR Co-prime:


Two integers 𝑎 and 𝑏, not both of which are zero, are said to be relatively prime OR
Co-prime whenever gcd(𝑎, 𝑏) = 1.

For example: The following pairs are co-prime:


{2, 5}, {−7, 3}, {13, 17}, {1, 0}, {23, 29}.

Theorem: If 𝑎 = 𝑏𝑞 + 𝑟, then gcd(𝑎, 𝑏) = gcd(𝑏, 𝑟).

For example:
1. Let 𝑎 = 39 and 𝑏 = 17. Then 39 = 17 × 2 + 5.
So by above theorem gcd(39, 17) = gcd(17, 5).
Further, 17 = 5 × 3 + 2. So gcd(17, 5) = gcd(5, 2).
Similarly, gcd(5, 2) = gcd(2, 1) = gcd(1, 0) = 1.
Hence, we can say that gcd(39, 17) = 1.

2. (171, 111) = (111, 60) = (60, 51) = (51, 9) = (9, 6) = (6, 3) = (3, 0) = 3.
3. (121, 67) = (67, 54) = (54, 13) = (13, 12) = (12, 1) = (1, 0) = 1.
4. (436, 71) = (71, 10) = (10, 1) = (1, 0) = 1.

Page 3 of 31
Remarks:
1. If 𝑎 and 𝑏 ere integers, not both of which are zero, then
gcd(𝑎, 𝑏) = gcd(−𝑎, 𝑏) = gcd(𝑎, −𝑏) = gcd(−𝑎, −𝑏).
2. For any integer 𝑘 ≠ 0, gcd(𝑘𝑎, 𝑘𝑏) = |𝑘| gcd(𝑎, 𝑏).
For example:
a. (12, 30) = 6(2, 5) = 6 × 1 = 6.
b. (96, 141) = 3(32, 47) = 3(32, 17) = 3(17, 15) = 3(15, 2) = 3(2, 1) = 3.
c. (1001, 11011) = 1001(1, 11) = 1001.

Compute the following:


1. (1414, 666)
Solution:
a 1414 666 82 10
b 666 82 10 2
q (quotient) 2 8 8 5
r (remainder) 82 10 2 0
We stop when the remainder is zero, the greatest common divisor is the last non-
zero remainder i.e., 2 in this case. Hence gcd(1414, 666) = 2.
2. (20785, 44305).
Solution: We always choose 𝑎 > 𝑏.
a 44305 20785 2735 1640 1095 545
b 20785 2735 1640 1095 545 5
q (quotient) 2 7 1 1 2 109
r (remainder) 2735 1640 1095 545 5 0
Therefore (20785, 44305) = 5.
3. (3255, 1785).
Solution:
a 3255 1785 1470 315 210
b 1785 1470 315 210 105
q (quotient) 1 1 4 1 2
r (remainder) 1470 315 210 105 0
Therefore (3255, 1785) = 105.

Page 4 of 31
4. (1598, 987).
Solution:
a 1598 987 611 376 235 141 94
b 987 611 376 235 141 94 47
q (quotient) 1 1 1 1 1 1 2
r (remainder) 611 376 235 141 94 47 0
Therefore (1598, 987) = 47.
5. (2537, −937).
Solution: We know that gcd(𝑎, 𝑏) = gcd(𝑎, −𝑏). So (2537, −937) = (2537, 937).
a 2537 937 663 274 115 44 27 17 10 7 3
b 937 663 274 115 44 27 17 10 7 3 1
q (quotient) 2 1 2 2 2 1 1 1 1 2 3
r (remainder) 663 274 115 44 27 17 10 7 3 1 0
Therefore (2537, −937) = (2537, 937) = 1.

S OLVING LINEAR D IOPHANTINE EQUATION : 𝑎𝑥 + 𝑏𝑦 = 𝑐.

Theorem: The linear Diophantine equation 𝑎𝑥 + 𝑏𝑦 = 𝑐 has a solution if and only if 𝑑|𝑐,
where 𝑑 = gcd(𝑎, 𝑏). If 𝑥0 , 𝑦0 is any particular solution of this equation, then all other
𝑏 𝑎
solutions are given by 𝑥 = 𝑥0 + (𝑑) 𝑡 and 𝑦 = 𝑦0 − (𝑑) 𝑡.

Solve: 3255𝑥 + 1785𝑦 = 105.


Solution: We know that
a 3255 1785 1470 315 210
b 1785 1470 315 210 105
q (quotient) 1 1 4 1 2
r (remainder) 1470 315 210 105 0
We now trace back from the remainder of the 2nd last column to find the values of 𝑥
and 𝑦.
105 = 315 − 210
= 315 − (1470 − 4 × 315) = 5 × 315 − 1470
= 5 × (1785 − 1470) − 1470 = 5 × 1785 − 6 × 1470

Page 5 of 31
= 5 × 1785 − 6 × (3255 − 1785) = 11 × 1785 − 6 × 3255.
So, 𝑥0 = −6 and 𝑦0 = 11.
All other solutions are
𝑏 𝑎
𝑥 = 𝑥0 + (𝑑) 𝑡 = −6 + 17𝑡 and 𝑦 = 𝑦0 − (𝑑) 𝑡 = 11 − 31𝑡, where 𝑡 ∈ ℤ.

Solve: 119𝑥 + 272𝑦 = gcd(119, 272).


Solution: We first find the gcd(119, 272).
a 272 119 34
b 119 34 17
q (quotient) 2 3 2
r (remainder) 34 17 0
Now we trace back and write:
17 = 119 − 3 × 34
= 119 − 3 × (272 − 2 × 119)
= 7 × 119 − 3 × 272.
So, 𝑥0 = 7 and 𝑦0 = −3.
All other solutions are
𝑏 𝑎
𝑥 = 𝑥0 + (𝑑) 𝑡 = 7 + 16𝑡 and 𝑦 = 𝑦0 − (𝑑) 𝑡 = −3 − 7𝑡, where 𝑡 ∈ ℤ.

Solve: 1769𝑥 + 2378𝑦 = 116.


Solution: We first find the gcd(1769, 2378).
a 2378 1769 609 551 58
b 1769 609 551 58 29
q (quotient) 1 2 1 9 2
r (remainder) 609 551 58 29 0
As gcd(1769, 2378) = 29 which divides 116. So 1769𝑥 + 2378𝑦 = 116, has a
solution
Now we trace back and write:

Page 6 of 31
29 = 551 − 9 × 58
= 551 − 9 × (609 − 551) = 10 × 551 − 9 × 609
= 10 × (1769 − 2 × 609) − 9 × 609 = 10 × 1769 − 29 × 609
= 10 × 1769 − 29 × (2378 − 1769) = 39 × 1769 − 29 × 2378
So we have,
29 = 39 × 1769 − 29 × 2378.
Therefore,
116 = 4 × 29 = (4 × 39)1769 − (4 × 29)2378.
Hence 𝑥0 = 156 and 𝑦0 = −116.
All other solutions are
𝑏 𝑎
𝑥 = 𝑥0 + (𝑑) 𝑡 = 156 + 61𝑡 and 𝑦 = 𝑦0 − (𝑑) 𝑡 = −116 − 82𝑡, where 𝑡 ∈ ℤ.

Solve: A mobile shop owner keeps two types of mobile covers: transparent cover and flip
cover. He sells flip covers for 𝑅𝑠. 31 each and transparent covers for 𝑅𝑠. 28 each. If
his total income in a day on these covers is 𝑅𝑠. 1460, how many of each type is sold
in a day?
Solution: Let 𝑥 and 𝑦 denote the number of flip covers and the number of transparent
covers sold respectively.
We need to solve the linear Diophantine equation 31𝑥 + 28𝑦 = 1460.
For this we first find the gcd(28, 31).
a 31 28 3
b 28 3 1
q (quotient) 1 9 3
r (remainder) 3 𝒅=𝟏 0
Now we trace back and write:
1 = 28 − 9 × 3 = 28 − 9 × (31 − 1 × 28) = 10 × 28 − 9 × 31.
Multiplying above equation by 1460 to get,
1460 = 14600 × 28 − 13140 × 31
So, 𝑥0 = −13140 and 𝑦0 = 14600.
All other solutions are
𝑏 𝑎
𝑥 = 𝑥0 + (𝑑) 𝑡 = −13140 + 28𝑡 and 𝑦 = 𝑦0 − (𝑑) 𝑡 = 14600 − 31𝑡,

Page 7 of 31
where 𝑡 ∈ ℤ.
As we want positive values of 𝑥 and 𝑦. So −13140 + 28𝑡 ≥ 0 i.e., 𝑡 ≥ 469.28.
We choose 𝑡 = 470.
Hence the required solution is
𝑥 = −13140 + 28 × 470 = 20,
𝑦 = 14600 − 31 × 470 = 30.

More challenges:
1. If 𝑎|𝑏, show that (−𝑎)|𝑏, 𝑎|(−𝑏), and (−𝑎)|(−𝑏).
2. Find the quotient and the remainder when 𝑎 is divided by 𝑏, where 𝑎 and 𝑏 are
given below:
i. 𝑎 = −100, 𝑏 = 17;
ii. 𝑎 = 43, 𝑏 = −7;
iii. 𝑎 = 289, 𝑏 = 18;
iv. 𝑎 = 25, 𝑏 = 76;
3. Prove or disprove: if 𝑎|(𝑏 + 𝑐), then either 𝑎|𝑏 or 𝑎|𝑐.
4. Find gcd(143, 227) , gcd(306, 657) and gcd(272, 1479).
5. Find the greatest common divisors of the following pair of integers, using Euclidean
algorithm:
i. (3083, 2893)
ii. (34, 55)
iii. (1598, 987)
iv. (112, 144)
6. Determine all solutions in integers of each of the following Diophantine equations:
a) 56𝑥 + 72𝑦 = 40;
b) 123𝑥 + 360𝑦 = 99;
c) 221𝑥 + 91𝑦 = 117;
d) 158𝑥 − 57𝑦 = 7;
e) 4𝑥 + 𝑦 = 44;
f) 252𝑥 + 198𝑦 = 18;
g) 84𝑥 − 438𝑦 = 156.

7. An ice-cream shop sells ice-cream in two flavors: Chocolate and vanilla. Price of
chocolate ice-cream is 𝑅𝑠. 90 and price of vanilla ice-cream is 𝑅𝑠. 74. How many
chocolate ice-cream and vanilla ice-cream should be sold to earn 𝑅𝑠. 5016 ?

Page 8 of 31
P RIMES

Primes: An integer 𝑝 > 1 is called a 𝑝𝑟𝑖𝑚𝑒 𝑛𝑢𝑚𝑏𝑒𝑟, or simply 𝑝𝑟𝑖𝑚𝑒, if its only
positive divisors are 1 and 𝑝.
An integer greater than 1 which is not prime is termed as 𝑐𝑜𝑚𝑝𝑜𝑠𝑖𝑡𝑒.
For example:
The first four prime integers are 2, 3, 5, 7 and 4, 6, 8, 9 are the first four composite
numbers.

Testing of primes
Theorem:

A positive integer 𝑎 is composite if and only if there is a prime divisor 𝑝 ≤ √𝑎.


Corollary:

A positive integer 𝑎 is prime, if there is no prime 𝑝 ≤ √𝑎 dividing 𝑎.


Example: Test whether 509 is prime.

Solution: As 22 < √509 < 23. We need to check out only those primes which are not
larger than 22; namely 2, 3, 5, 7, 11, 13, 17, 19.
Dividing 509 by each of these in turn, we find that none is dividing 509.
Therefore, 509 is a prime number.
Example: Test whether 2093 is prime.
Solution: As 45 < 2093 < 46. We need to check out only those primes which are not
larger than 45; namely 2, 3, 5, 7, 11, 13, 17, 19, 23, 29, 31, 37, 41, 43.
Dividing 509 by each of these in turn, we find that 7 divides 2093.
Therefore, 2093 is not a prime number.
Technique to find all primes below a given integer 𝒏
Sieve of Eratosthenes:
Step 1: List all the integers from 2 to 𝑛 in their natural order.

Step 2: Strike out all the multiples of the primes 𝑝 ≤ √𝑛 , except 𝑝 itself.
Step 3: The integers which are remaining in the list are all the primes less than 𝑛.

Page 9 of 31
For example: Find all the primes less than 100.

Solution: As √100 = 10, so we strike out only those numbers which are multiples of
2, 3, 5 and 7.
2 3 4 5 6 7 8 9 10
11 12 13 14 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
81 82 83 84 85 86 87 88 89 90
91 92 93 94 95 96 97 98 99 100
The 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.

Prime Number Theorem:


Let 𝜋(𝑁) denote the number of primes less than or equal to 𝑁, then
𝜋(𝑁)
lim = 1.
𝑁⟶∞ 𝑁
( )
log 𝑁
Table:

𝑵 10 50 100 1000 104 105 106 107


𝝅(𝑵) 4 15 25 168 1229 9592 78498 664579
𝑵
4.34 12.78 21.71 144.76 1085.73 8685 72382.41 620420.68
𝐥𝐨𝐠 𝑵
𝜋(𝑁)
𝑁 0.92 1.17 1.15 1.16 1.13 1.10 1.08 1.07
( )
log 𝑁

Page 10 of 31
More challenges:
1. Check whether the following integers are prime. If not, then find their prime
factors:
i. 2093
ii. 509
iii. 349
iv. 209
v. 701
vi. 1009
2. Employing the 𝑆𝑖𝑒𝑣𝑒 𝑜𝑓 𝐸𝑟𝑎𝑡𝑜𝑠𝑡ℎ𝑒𝑛𝑒𝑠, Obtain all the primes between 100 and
200.

Page 11 of 31
C ONGRUENCES

Definition: Let 𝑛 be a fixed positive integer. Two integers 𝑎 and 𝑏 are said to be
congruent modulo 𝑛, symbolized by
𝑎 ≡ 𝑏 (𝑚𝑜𝑑 𝑛)
if 𝑛 divides the difference 𝑎 − 𝑏; i.e., (𝑎 − 𝑏) = 𝑘𝑛 for some 𝑘 ∈ ℤ.

For example:
1. 13 ≡ 3(𝑚𝑜𝑑 5), as 5 divides (13 − 3) = 10.
2. 93 ≡ 0(𝑚𝑜𝑑 3), as 3 divides (93 − 0) = 93.
3. −51 ≡ 5 (𝑚𝑜𝑑 7), as 7 divides (−51 − 5) = −56.
4. 49 ≡ −1 (𝑚𝑜𝑑 10), as 10 divides (49 − (−1)) = 50.

Theorem: Let 𝑛 > 0 be fixed and 𝑎, 𝑏, 𝑐, 𝑑 be arbitrary integers.


Then the following properties hold:
1. 𝑎 ≡ 𝑎( 𝑚𝑜𝑑 𝑛).
2. If 𝑎 ≡ 𝑏 (𝑚𝑜𝑑 𝑛), then 𝑏 ≡ 𝑎 (𝑚𝑜𝑑 𝑛).
3. If 𝑎 ≡ 𝑏 (𝑚𝑜𝑑 𝑛) and 𝑏 ≡ 𝑐 (𝑚𝑜𝑑 𝑛), then 𝑎 ≡ 𝑐 (𝑚𝑜𝑑 𝑛).
4. If 𝑎 ≡ 𝑏 (𝑚𝑜𝑑 𝑛) and 𝑐 ≡ 𝑑 (𝑚𝑜𝑑 𝑛), then 𝑎 + 𝑐 ≡ 𝑏 + 𝑑 (𝑚𝑜𝑑 𝑛)
and 𝑎𝑐 ≡ 𝑏𝑑 (𝑚𝑜𝑑 𝑛).
5. If 𝑎 ≡ 𝑏 (𝑚𝑜𝑑 𝑛), then 𝑎𝑘 ≡ 𝑏 𝑘 (𝑚𝑜𝑑 𝑛) for any positive integer 𝑘.
Proof:
1. For any integer 𝑎, 𝑎 − 𝑎 = 0, and we know that any non-zero number divides 0,
so 𝑛 divides 0. Therefore 𝑎 ≡ 𝑎 (𝑚𝑜𝑑 𝑛).

2. Given 𝑎 ≡ 𝑏 (𝑚𝑜𝑑 𝑛) this implies that 𝑛 divides (𝑎 − 𝑏), which implies that 𝑛
divides −(𝑎 − 𝑏) = (𝑏 − 𝑎). Hence 𝑏 ≡ 𝑎 (𝑚𝑜𝑑 𝑛).

3. Given 𝑎 ≡ 𝑏 (𝑚𝑜𝑑 𝑛) and 𝑏 ≡ 𝑐 (𝑚𝑜𝑑 𝑛). i.e.,


𝑛 divides (𝑎 − 𝑏) and 𝑛 divides (𝑏 − 𝑐).
i.e., (𝑎 − 𝑏) = 𝑘1 𝑛 and (𝑏 − 𝑐) = 𝑘2 𝑛, for some 𝑘1 , 𝑘2 ∈ ℤ.
Now (𝑎 − 𝑏) + (𝑏 − 𝑐) = (𝑘1 + 𝑘2 )𝑛.
So 𝑛 divides (𝑎 − 𝑏) + (𝑏 − 𝑐) = 𝑎 − 𝑐.
Hence 𝑎 ≡ 𝑐 (𝑚𝑜𝑑 𝑛).

Page 12 of 31
4. Given 𝑎 ≡ 𝑏 (𝑚𝑜𝑑 𝑛) and 𝑐 ≡ 𝑑 (𝑚𝑜𝑑 𝑛).
i.e., 𝑛 divides (𝑎 − 𝑏) and 𝑛 divides (𝑐 − 𝑑).
i.e., (𝑎 − 𝑏) = 𝑘1 𝑛 and (𝑐 − 𝑑) = 𝑘2 𝑛, for some 𝑘1 , 𝑘2 ∈ ℤ.
Now (𝑎 − 𝑏) + (𝑐 − 𝑑) = (𝑘1 + 𝑘2 )𝑛.
So 𝑛 divides (𝑎 − 𝑏) + (𝑐 − 𝑑) = (𝑎 + 𝑐) − (𝑏 + 𝑑)
Thus, 𝑎 + 𝑐 ≡ 𝑏 + 𝑑 (𝑚𝑜𝑑 𝑛).
Now 𝑎𝑐 = (𝑏 + 𝑘1 𝑛)(𝑑 + 𝑘2 𝑛) = 𝑏𝑑 + (𝑏𝑘2 + 𝑑𝑘1 + 𝑘1 𝑘2 𝑛)𝑛.
So 𝑎𝑐 − 𝑏𝑑 = (𝑏𝑘2 + 𝑑𝑘1 + 𝑘1 𝑘2 𝑛)𝑛.
So 𝑛 divides 𝑎𝑐 − 𝑏𝑑.
Thus 𝑎𝑐 ≡ 𝑏𝑑 (𝑚𝑜𝑑 𝑛).

5. Given 𝑎 ≡ 𝑏 (𝑚𝑜𝑑 𝑛), this implies that 𝑛 divides (𝑎 − 𝑏).


So, (𝑎 − 𝑏) = 𝑘1 𝑛.
Now, 𝑎𝑘 − 𝑏 𝑘 = (𝑎 − 𝑏)(𝑎𝑛−1 + 𝑎𝑛−2 𝑏 + 𝑎𝑛−3 𝑏 2 + ⋯ + 𝑎𝑏 𝑛−2 + 𝑏 𝑛−1 ) = 𝑘1 𝑛𝑡,
Where 𝑡 = (𝑎𝑛−1 + 𝑎𝑛−2 𝑏 + 𝑎𝑛−3 𝑏 2 + ⋯ + 𝑎𝑏 𝑛−2 + 𝑏 𝑛−1 ) ∈ ℤ.
Thus, 𝑛 divides 𝑎𝑘 − 𝑏 𝑘 , for any 𝑘 ∈ ℤ.
Therefore 𝑎𝑘 ≡ 𝑏 𝑘 (𝑚𝑜𝑑 𝑛), for any 𝑘 ∈ ℤ.
Examples:
1. Find the least positive residue of 2644 modulo 645.
Solution: We compute the least positive residues of 2, 22 , 24 , 28 , … , 2512 by
successively squaring and reducing modulo 645.
2 ≡ 2 (𝑚𝑜𝑑 645)
22 ≡ 4 (𝑚𝑜𝑑 645)
24 ≡ 42 (𝑚𝑜𝑑 645) ≡ 16 (𝑚𝑜𝑑 645)
28 ≡ 162 (𝑚𝑜𝑑 645) ≡ 256(𝑚𝑜𝑑 645)
216 ≡ 2562 = 65536 = (645 × 101 + 391) ≡ 391(𝑚𝑜𝑑 645)
232 ≡ 3912 = 152881 = (645 × 237 + 16) ≡ 16(𝑚𝑜𝑑 645)
264 ≡ 162 ≡ 256 (𝑚𝑜𝑑 645)
2128 ≡ 2562 ≡ 391 (𝑚𝑜𝑑 645)
2256 ≡ 3912 ≡ 16 (𝑚𝑜𝑑 645)
2512 ≡ 162 ≡ 256 (𝑚𝑜𝑑 645)
Therefore,
2644 = 2512 2128 24 ≡ 256 ⋅ 391 ⋅ 16
≡ 1601536 ≡ (645 × 2483 + 1) ≡ 1 (𝑚𝑜𝑑 645).
Page 13 of 31
2. Find the least non-negative residue modulo 13 of
a) 22
b) 100
c) 1001
d) −1
e) −100
f) −1000.

3. What time does a clock read


a) 29 hours after it reads 11 o’clock
b) 100 hours after it reads 2 o’clock
c) 50 hours after it reads 6 o’clock
d) 230 hours after it reads 9 o’clock.

4. Find the least non-negative residue modulo 47 of


a) 232
b) 247
c) 2200
d) 292 .

5. Find the least positive residues of


a) 6! modulo 7
b) 10! modulo 11
c) 12! modulo 13 (TRY)
d) 16! modulo 17 (TRY.)
Solution:
a)
4! = 24 ≡ 3 𝑚𝑜𝑑 (7)
5! ≡ 5 × 3 ≡ 15 ≡ 1 ( 𝑚𝑜𝑑 7)
6! ≡ 6 × 1 ≡ 6 (𝑚𝑜𝑑 7)
b)
5! = 120 ≡ −1(𝑚𝑜𝑑 11)
6! ≡ −6 (𝑚𝑜𝑑 11) ≡ 5 (𝑚𝑜𝑑 11)
7! ≡ 35 ≡ 2(𝑚𝑜𝑑 11)
8! ≡ 16 ≡ 5 (𝑚𝑜𝑑 11)
9! ≡ 45 ≡ 1 (𝑚𝑜𝑑 11)
10! ≡ 10 (𝑚𝑜𝑑 11)

Page 14 of 31
Fermat’s Little Theorem:
If 𝑝 is a prime and 𝑝 ∤ 𝑎, then 𝑎𝑝−1 ≡ 1 (𝑚𝑜𝑑 𝑝).
For example:
1. 246 ≡ 1 (𝑚𝑜𝑑 47).
2. 4547 ≡ 45 (𝑚𝑜𝑑 47).
3. 594 = 546 546 52 ≡ 25(𝑚𝑜𝑑 47).
4. 32022 = (396 )21 36 ≡ 36 (𝑚𝑜𝑑 97) ≡ 35 × 3 ≡ 49 × 3 ≡ 147 ≡ 50(𝑚𝑜𝑑 97).
5. 538 = (510 )3 58 ≡ 58 (𝑚𝑜𝑑 11) ≡ 254 ≡ 34 ≡ 81 ≡ 4 (𝑚𝑜𝑑 11).

Euler phi-function :
Let 𝑛 be a positive integer. The 𝐸𝑢𝑙𝑒𝑟 𝑝ℎ𝑖 − 𝑓𝑢𝑛𝑐𝑡𝑖𝑜𝑛 𝜙(𝑛) is defined to be
the number of positive integers less than or equal to 𝑛 and relatively prime
(co-prime) to 𝑛.
For example:
1. 𝜙(10) = 4.
Since 1, 3, 7, 9 are less than or equal to 10 and are co-prime to 10.

2. 𝜙(7) = 6.
Since 1, 2, 3, 4, 5, 6 are less than or equal to 7 and are co-prime to 7.

3. 𝜙(15) = 8.
Since 1, 2, 4, 7, 8, 11, 13, 14 are less than or equal to 15 and are co-prime to 15.
Notes:
1. If 𝑝 is a prime number then 𝜙(𝑝𝑛 ) = 𝑝𝑛 − 𝑝𝑛−1 .
In particular, 𝜙(𝑝) = 𝑝 − 1.
2. If 𝑚, 𝑛 are two co-prime integers, then 𝜙(𝑚𝑛) = 𝜙(𝑚)𝜙(𝑛).

For example:
1. 𝜙(25) = 𝜙(52 ) = 52 − 5 = 20.
2. 𝜙(97) = 96. Since 97 is prime.
3. 𝜙(15) = 𝜙(3)𝜙(5) = 2 × 4 = 8. Since 3 and 5 are co-primes.
4. 𝜙(36) = 𝜙(22 ⋅ 32 ) = 𝜙(22 )𝜙(32 ) = (22 − 2)(32 − 3) = 12.
5. 𝜙(100) = 𝜙(22 ⋅ 52 ) = 𝜙(22 )𝜙(52 ) = (22 − 2)(52 − 5) = 40.
6. 𝜙(2022) = 𝜙(2 ⋅ 3 ⋅ 337) = 𝜙(2)𝜙(3)𝜙(337) = 1 × 2 × 336 = 672.
7. 𝜙(1729) = 𝜙(7 ⋅ 13 ⋅ 19) = 6 × 12 × 18 = 1080.
𝟏𝟕𝟐𝟗 is called 𝑯𝒂𝒓𝒅𝒚 − 𝑹𝒂𝒎𝒂𝒏𝒖𝒋𝒂𝒏 number.

Page 15 of 31
Euler’s Theorem:
If 𝑚 is a positive integer and 𝑎 is an integer with gcd(𝑎, 𝑚) = 1, then

𝑎𝜙(𝑚) ≡ 1 (𝑚𝑜𝑑 𝑚).


In particular: If 𝑚 is prime then we get 𝐹𝑒𝑟𝑚𝑎𝑡 ′ 𝑠 𝐿𝑖𝑡𝑡𝑙𝑒 𝑇ℎ𝑒𝑜𝑟𝑒𝑚.
For example:
1. 720 ≡ 1 (𝑚𝑜𝑑 25).
2. 94 ≡ 1 (𝑚𝑜𝑑 10).
3. 21080 ≡ 1 (𝑚𝑜𝑑 1729).
4. 9940 ≡ 1 (𝑚𝑜𝑑 (100).
Note:
1. The least residue of a number 𝑚 modulo 10 gives the unit digit of 𝑚.
2. The least residue of a number 𝑚 modulo 100 gives the last two digits of 𝑚.
3. The least residue of a number 𝑚 modulo 1000 gives the last three digits of 𝑚.

Examples:
1. Find the last digit of 71000 .
Solution: 72 = 49 ≡ −1 (𝑚𝑜𝑑 10).
So, 71000 = (72 )500 ≡ (−1)500 ≡ 1 (𝑚𝑜𝑑 10).
Hence the last digit of 71000 is 1.
2. Find the least positive residue of 3100000 modulo 35.
Solution: Here 𝜙(35) = 𝜙(5 ⋅ 7) = 𝜙(5)𝜙(7) = 4 × 6 = 24 and gcd(3, 35) = 1.
By Euler’s Theorem,
324 ≡ 1(𝑚𝑜𝑑 35).
So,
3100000 = (324 )4166 316 ≡ 316 (𝑚𝑜𝑑 35).
Now,
33 = 81 ≡ 11 (𝑚𝑜𝑑 35)
3 ≡ 112 ≡ 121 ≡ 16 (𝑚𝑜𝑑 35)
6

312 ≡ 162 ≡ 256 ≡ 11 (𝑚𝑜𝑑 35)


Hence
3100000 ≡ 316 = 312 ⋅ 33 ⋅ 3 ≡ 11 ⋅ 11 ⋅ 3 ≡ 121 ⋅ 3 ≡ 16 ⋅ 3 ≡ 48 ≡ 13 (𝑚𝑜𝑑 35).

Page 16 of 31
L INEAR C ONGRUENCE

 The linear congruence 𝑎𝑥 ≡ 𝑏 (𝑚𝑜𝑑 𝑛) has a solution if and only if 𝑑|𝑏,


where 𝑑 = gcd(𝑎, 𝑛).
 If 𝑑|𝑏, then it has 𝑑 mutually incongruent solutions modulo 𝑛.
 If 𝑥0 is one specific solution of 𝑎𝑥 ≡ 𝑏 (𝑚𝑜𝑑 𝑛) then the remaining (𝑑 − 1) solutions
are
𝑛 2𝑛 3𝑛 (𝑑 − 1)𝑛
𝑥0 + , 𝑥0 + , 𝑥0 + ,… , 𝑥0 + .
𝑑 𝑑 𝑑 𝑑

Example 1. Find all solutions of 9𝑥 ≡ 12 (𝑚𝑜𝑑 15).


Solution: Here 𝑎 = 9, 𝑏 = 12 and 𝑛 = 15.
Now 𝑑 = gcd(𝑎, 𝑛) = gcd(9, 15) = 3 and 3|12.
There are exactly three incongruent solutions modulo 15.
To find a particular solution 𝑥0 , we consider the linear diophantine equation
9𝑥 + 15𝑦 = 12.
𝑎 9 9 6
𝑛 15 6 3
q (quotient) 1 1 2
r (remainder) 6 3 0

Now we trace back and write:


3 = 9 − 1 × 6 = 9 − 1(15 − 9) = 2 × 9 − 1 × 15.
So,
12 = 8 × 9 − 4 × 15.
Going modulo 15. We get,
9 × 8 ≡ 12 (𝑚𝑜𝑑 15).
Hence 𝑥0 = 8 is a particular solution.
Other solutions are 𝑥0 + 𝑑, 𝑥0 + 2𝑑 modulo 15
i.e., 8 + 3 = 11 and 8 + 6 = 14.
Therefore all three solutions are 8, 11, 14 modulo 15.

Page 17 of 31
Example 2. Find all solutions of 7𝑥 ≡ 22 (𝑚𝑜𝑑 31).
Solution: Here 𝑎 = 7, 𝑏 = 22 and 𝑛 = 31.
𝑛 31 7 3
𝑎 7 3 1
q (quotient) 4 2 3
r (remainder) 3 1 0
So
gcd(31, 7) = 1 which divides 22. Therefore the congruence 7𝑥 ≡ 22 (𝑚𝑜𝑑 31)
has unique solution.
We trace back and write:
1 = 7 − 3 × 2 = 7 − (31 − 7 × 4) × 2 = 5 × 7 − 31.
Therefore,
22 = 110 × 7 − 22 × 31.
Going modulo 31 gives,
7 × 110 ≡ 22 (𝑚𝑜𝑑 31)
i.e.,
7 × 17 ≡ 22 (𝑚𝑜𝑑 31).
Hence 𝑥0 = 17 is a solution.

Example 3. Find all solutions of 15𝑥 ≡ 9 (𝑚𝑜𝑑 25).


Solution: Here 𝑎 = 15, 𝑏 = 9 and 𝑛 = 25.
𝑛 25 15 10
𝑎 15 10 5
q (quotient) 1 1 2
r (remainder) 10 5 0
So, gcd(25, 15) = 5 which does not divide 9. Therefore the congruence 15𝑥 ≡
9 (𝑚𝑜𝑑 25) does not have a solution.

Example 4. Find all solutions of 128𝑥 ≡ 833 (𝑚𝑜𝑑 1001).


Solution: Here 𝑎 = 128, 𝑏 = 833 and 𝑛 = 1001.

Page 18 of 31
𝑛 1001 128 105 23 13 10 3
𝑎 128 105 23 13 10 3 3
q (quotient) 7 1 4 1 1 3 3
r 105 23 13 10 3 𝟏 0
(remainder)
So, gcd(1001, 128) = 1 which divides 833.
Therefore the congruence 128𝑥 ≡ 833 (𝑚𝑜𝑑 1001) has unique solution.
Now we trace back and write:
1 = 10 − 3 × 3
1 = 10 − 3 × (13 − 10) = 4 × 10 − 3 × 13
1 = 4 × (23 − 13) − 3 × 13 = 4 × 23 − 7 × 13
1 = 4 × 23 − 7 × (105 − 4 × 23) = 32 × 23 − 7 × 105
1 = 32 × (128 − 105) − 7 × 105 = 32 × 128 − 39 × 105
1 = 32 × 128 − 39 × (1001 − 7 × 128) = 305 × 128 − 39 × 1001.
Going modulo 1001, we get
128 × 305 ≡ 1 (𝑚𝑜𝑑 1001).
So,
128 × (833 × 305) ≡ 833 (𝑚𝑜𝑑 1001).
i.e.,
128 × 812 ≡ 833 (𝑚𝑜𝑑 1001).
Hence 𝑥0 = 812 is a solution.
Example 5: Find the inverse of 17 modulo 21. i.e., Solve 17𝑥 ≡ 1 (𝑚𝑜𝑑 21).
Solution: Here 𝑎 = 17, 𝑏 = 1 and 𝑛 = 21.
𝑛 21 17 4
𝑎 17 4 1
q (quotient) 1 4 4
r (remainder) 4 𝟏 0
So, gcd(21, 17) = 1 which divides 1.
Therefore the congruence 17𝑥 ≡ 1 (𝑚𝑜𝑑 21) has unique solution.
Now we trace back and write:
1 = 17 − 4 × 4 = 17 − 4 × (21 − 17) = 5 × 17 − 4 × 21.
Going modulo 21, gives
17 × 5 ≡ 1 (𝑚𝑜𝑑 21).
Therefore 5 is the inverse of 17 modulo 21.
Example 6: Find the inverse of 16 modulo 17. i.e., Solve 16𝑥 ≡ 1 (𝑚𝑜𝑑 17).
Solution: Here 𝑎 = 16, 𝑏 = 1 and 𝑛 = 17.

Page 19 of 31
𝑛 17 16
𝑎 16 1
q (quotient) 1 16
r (remainder) 𝟏 0

So, gcd(17, 16) = 1 which divides 1.


Therefore the congruence 16𝑥 ≡ 1 (𝑚𝑜𝑑 17) has unique solution.
Now we trace back and write:
1 = 17 − 16.
Going modulo 17, gives
16 × (−1) ≡ 1 (𝑚𝑜𝑑 21).
Therefore −1 ≡ 16 (𝑚𝑜𝑑 17) is the inverse of 16 modulo 17.

More challenges:
1. Find all the solutions of the congruences
a) 20𝑥 ≡ 4 (𝑚𝑜𝑑 30);
b) 64𝑥 ≡ 83 (𝑚𝑜𝑑 105);
c) 20𝑥 ≡ 30 (𝑚𝑜𝑑 4);
d) 589𝑥 ≡ 209 (𝑚𝑜𝑑 817);
e) 49𝑥 ≡ 5000 (𝑚𝑜𝑑 999);
f) 57𝑥 ≡ 87 (𝑚𝑜𝑑 105).

2. How many solutions are there for each of the following congruences:
a) 15𝑥 ≡ 25 (𝑚𝑜𝑑 35);
b) 15𝑥 ≡ 24 (𝑚𝑜𝑑 35);
c) 15𝑥 ≡ 0 (𝑚𝑜𝑑 35).

3. Find an inverse modulo 19 of


a) 7;
b) 18;
c) 10;
d) 11.

Page 20 of 31
C HINESE R EMAINDER T HEOREM

Theorem: Let 𝑛1 , 𝑛2 , … , 𝑛𝑟 be positive integers such that gcd(𝑛𝑖 , 𝑛𝑗 ) = 1 for 𝑖 ≠ 𝑗. Then


the system of linear congruence’s
𝑥 = 𝑎1 (𝑚𝑜𝑑 𝑛1 )
𝑥 = 𝑎2 (𝑚𝑜𝑑 𝑛2 )

𝑥 = 𝑎𝑟 (𝑚𝑜𝑑 𝑛𝑟 )
has a simultaneous solution, which is unique modulo 𝑛1 𝑛2 … 𝑛𝑟 .

Steps to solve simultaneous system of linear congruences of above type:


𝑛
1. Let 𝑛 = 𝑛1 𝑛2 … 𝑛𝑟 and let 𝑁𝑘 = 𝑛 .
𝑘
2. Solve the congruence 𝑁𝑘 𝑥 ≡ 1 (𝑚𝑜𝑑 𝑛𝑘 ) and call the unique solution 𝑥𝑘 .
3. The required solution is
𝑥 = 𝑎1 𝑁1 𝑥1 + 𝑎2 𝑁2 𝑥2 + ⋯ + 𝑎𝑟 𝑁𝑟 𝑥𝑟
Modulo 𝑛.

Example 1: Solve the following simultaneous system of linear congruences:


𝑥 ≡ 2 (𝑚𝑜𝑑 3)
𝑥 ≡ 3 (𝑚𝑜𝑑 5)
𝑥 ≡ 2 (𝑚𝑜𝑑 7).
Solution: Here 𝑎1 = 2, 𝑎2 = 3, 𝑎3 = 2, 𝑛1 = 3, 𝑛2 = 5 and 𝑛3 = 7.
As gcd(𝑛𝑖 , 𝑛𝑗 ) = 1 for 𝑖 ≠ 𝑗. So the system has a solution.
𝑛 105 𝑛 105
Let 𝑛 = 𝑛1 𝑛2 𝑛3 = 105 and let 𝑁1 = 𝑛 = = 35, 𝑁2 = 𝑛 = = 21 and
1 3 2 5
𝑛 105
𝑁3 = 𝑛 = = 15.
3 7

Now the linear congruences


35𝑥 ≡ 1 (𝑚𝑜𝑑 3) ⟹ 2𝑥 ≡ 1(𝑚𝑜𝑑 3),
21𝑥 ≡ 1 (𝑚𝑜𝑑 5) ⟹ 𝑥 ≡ 1 (𝑚𝑜𝑑 5),
15𝑥 ≡ 1 (𝑚𝑜𝑑 7) ⟹ 𝑥 ≡ 1(𝑚𝑜𝑑 7)

Page 21 of 31
has the solution 𝑥1 = 2, 𝑥2 = 1, 𝑥3 = 1 respectively.
Thus the solution of the system is
𝑥 = 𝑎1 𝑁1 𝑥1 + 𝑎2 𝑁2 𝑥2 + ⋯ + 𝑎𝑟 𝑁𝑟 𝑥𝑟
= 2 ⋅ 35 ⋅ 2 + 3 ⋅ 21 ⋅ 1 + 2 ⋅ 15 ⋅ 1 = 233 ≡ 23 (𝑚𝑜𝑑 105)

Example 2: Solve the following simultaneous system of linear congruences:


𝑥 ≡ 5 (𝑚𝑜𝑑 6)
𝑥 ≡ 4 (𝑚𝑜𝑑 11)
𝑥 ≡ 3 (𝑚𝑜𝑑 17).
Solution: Here 𝑎1 = 5, 𝑎2 = 4, 𝑎3 = 3, 𝑛1 = 6, 𝑛2 = 11 and 𝑛3 = 17.
As gcd(𝑛𝑖 , 𝑛𝑗 ) = 1 for 𝑖 ≠ 𝑗. So the system has a solution.
𝑛 1122 𝑛 1122
Let 𝑛 = 𝑛1 𝑛2 𝑛3 = 1122 and let 𝑁1 = 𝑛 = = 187, 𝑁2 = 𝑛 = = 102
1 6 2 11
𝑛 1122
and 𝑁3 = 𝑛 = = 66.
3 17

Now the linear congruences


187𝑥 ≡ 1 (𝑚𝑜𝑑 6) ⟹ 𝑥 ≡ 1(𝑚𝑜𝑑 6),
102𝑥 ≡ 1 (𝑚𝑜𝑑 11) ⟹ 3𝑥 ≡ 1 (𝑚𝑜𝑑 11),
66𝑥 ≡ 1 (𝑚𝑜𝑑 17) ⟹ −2𝑥 ≡ 1(𝑚𝑜𝑑 17)
has the solution 𝑥1 = 1, 𝑥2 = 4, 𝑥3 = 8 respectively.
Thus, the solution of the system is
𝑥 = 𝑎1 𝑁1 𝑥1 + 𝑎2 𝑁2 𝑥2 + ⋯ + 𝑎𝑟 𝑁𝑟 𝑥𝑟
= 5 ⋅ 187 ⋅ 1 + 4 ⋅ 102 ⋅ 4 + 3 ⋅ 66 ⋅ 8 = 4151 ≡ 785 (𝑚𝑜𝑑 1122).
Example 3: A certain integer between 1 and 1200 leaves the remainder 1, 2, 6 when
divided by 9, 11, 13 respectively. What is the integer?
Solution: Let 𝑥 be the required number, then by given information we have
𝑥 ≡ 1 (𝑚𝑜𝑑 9), 𝑥 ≡ 2 (𝑚𝑜𝑑 11), 𝑥 ≡ 6 (𝑚𝑜𝑑 13).
Here 𝑎1 = 1, 𝑎2 = 2, 𝑎3 = 6, 𝑛1 = 9, 𝑛2 = 11 and 𝑛3 = 13.
As gcd(𝑛𝑖 , 𝑛𝑗 ) = 1 for 𝑖 ≠ 𝑗. So the system has a solution.

Page 22 of 31
𝑛 𝑛 𝑛
Let 𝑛 = 𝑛1 𝑛2 𝑛3 = 1287 and let 𝑁1 = = 143, 𝑁2 = = 117, 𝑁3 = = 99.
𝑛1 𝑛2 𝑛3

Now the linear congruences


143𝑥 ≡ 1 (𝑚𝑜𝑑 9) ⟹ 8𝑥 ≡ 1(𝑚𝑜𝑑 9),
117𝑥 ≡ 1 (𝑚𝑜𝑑 11) ⟹ 7𝑥 ≡ 1 (𝑚𝑜𝑑 11),
99𝑥 ≡ 1 (𝑚𝑜𝑑 13) ⟹ 8𝑥 ≡ 1(𝑚𝑜𝑑 13)
has the solution 𝑥1 = 8, 𝑥2 = 8, 𝑥3 = 5 respectively.
Thus, the solution of the system is
𝑥 = 𝑎1 𝑁1 𝑥1 + 𝑎2 𝑁2 𝑥2 + ⋯ + 𝑎𝑟 𝑁𝑟 𝑥𝑟
= 1 ⋅ 143 ⋅ 8 + 2 ⋅ 117 ⋅ 8 + 6 ⋅ 99 ⋅ 5 = 5986 ≡ 838(𝑚𝑜𝑑 1287).
Therefore 𝑥 = 838 is the required integer.
More challenges:
1. There are some apples in a bucket. If they are removed from it picking 2 at a time
one remains in the basket, if they are removed 3 at a time, two remains in the
bucket, if they are removed 5 at a time, four remains. No apple remains if we remove
7 at a time. What is the smallest number of apples in the bucket?
2. Solve the following simultaneous system of linear congruences:
𝑥 ≡ 3 (𝑚𝑜𝑑 4)
𝑥 ≡ 4 (𝑚𝑜𝑑 5)
𝑥 ≡ 5 (𝑚𝑜𝑑 7).
3. (Ancient Chinese problem). A band of 17 pirates stole a sack of gold coins. When
they tried to divide the fortune into equal portions, 3 coins remained. In the ensuing
brawl of over who should get the extra coins, one pirate was killed. The wealth was
redistributed, but this time an equal division left 10 coins. Again, an argument
developed in which another pirate was killed. But now the the total fortune was
evenly distributed among the survivors. What was the least number of coins that
could have been stolen?
Answer: 3930.

Page 23 of 31
Q UADRATIC C ONGRUENCES

Definition (Quadratic residue):


If 𝑚 is a positive integer, we say that the integer 𝑎 is a quadratic residue of 𝑚 if
(𝑎, 𝑚) = 1 and the congruence 𝑥 2 ≡ 𝑎 (𝑚𝑜𝑑 𝑚) has a solution. If the congruence
𝑥 2 ≡ 𝑎(𝑚𝑜𝑑 𝑚) has no solution, we say that 𝑎 is a quadratic nonresidue of 𝑚.
In simple language:
If 𝑎 is perfect square modulo 𝑚, then 𝑎 is a quadratic residue of 𝑚, otherwise 𝑎 is a
quadratic nonresidue of 𝑚.
For example:
1. If 𝑚 = 7 then 𝑎 = 1, 2, 3, 4, 5, 6 satisfies (𝑎, 𝑚) = 1.
12 ≡ 1 (𝑚𝑜𝑑 7),
22 ≡ 4 (𝑚𝑜𝑑 7),

32 = 9 ≡ 2 (𝑚𝑜𝑑 7),

42 = 16 ≡ 2 (𝑚𝑜𝑑 7),
52 = 25 ≡ 4 (𝑚𝑜𝑑 7),

62 = 36 ≡ 1 (𝑚𝑜𝑑 7).

Here, 1, 2, 4 are perfect square modulo 7, so 1, 2, 4 are quadratic residue of 7.


And the remaining i.e., 3, 5, 6 are quadratic nonresidue of 7.
2. If 𝑚 = 9 then 𝑎 = 1, 2, 4, 5, 7, 8 satisfies (𝑎, 𝑚) = 1.
12 ≡ 1 (𝑚𝑜𝑑 9),
22 ≡ 4 (𝑚𝑜𝑑 9),
42 = 16 ≡ 7 (𝑚𝑜𝑑 9),
52 = 25 ≡ 7 (𝑚𝑜𝑑 9),
72 = 49 ≡ 4 (𝑚𝑜𝑑 9),
82 = 64 ≡ 1 (𝑚𝑜𝑑 9).
Here, 1, 4, 7 are perfect square modulo 9, so 1, 4, 7 are quadratic residue of 9.
And the remaining i.e., 2, 5, 8 are quadratic nonresidue of 9.
Theorem 1: Let 𝑝 be an odd prime and 𝑎 an integer not divisible by 𝑝. Then, the
congruence
𝑥 2 ≡ 𝑎 (𝑚𝑜𝑑 𝑝)
has either no solutions or exactly two incongruent solutions modulo 𝑝.

Page 24 of 31
(If 𝑥0 is one solution of 𝑥 2 ≡ 𝑎 (𝑚𝑜𝑑 𝑝) then 𝑝 − 𝑥0 is the other solution modulo 𝑝. )

Definition (Legendre Symbol):


𝑎
Let 𝑝 be an odd prime and 𝑎 be an integer with (𝑎, 𝑝) = 1. The Legendre symbol (𝑝)
is defined by
𝑎 1 𝑖𝑓 𝑎 𝑖𝑠 𝑞𝑢𝑎𝑑𝑟𝑎𝑡𝑖𝑐 𝑟𝑒𝑠𝑖𝑑𝑢𝑒 𝑜𝑓 𝑝
( )={
𝑝 −1 𝑖𝑓 𝑎 𝑖𝑠 𝑞𝑢𝑎𝑑𝑟𝑎𝑡𝑖𝑐 𝑛𝑜𝑛𝑟𝑒𝑠𝑖𝑑𝑢𝑒 𝑜𝑓 𝑝

For example:
If 𝑝 = 13 then 𝑎 = 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12 satisfies (𝑎, 𝑝) = 1.
12 ≡ 1 (𝑚𝑜𝑑 13), 122 ≡ 1 (𝑚𝑜𝑑 13),
22 ≡ 4 (𝑚𝑜𝑑 13), 112 ≡ 4 (𝑚𝑜𝑑 13),
32 ≡ 9 (𝑚𝑜𝑑 13), 102 ≡ 9 (𝑚𝑜𝑑 13),
42 ≡ 3 (𝑚𝑜𝑑 13), 92 ≡ 3 (𝑚𝑜𝑑 13),
52 ≡ 12(𝑚𝑜𝑑 13), 82 ≡ 12 (𝑚𝑜𝑑 13),
62 ≡ 10 (𝑚𝑜𝑑 13), 72 ≡ 10 (𝑚𝑜𝑑 13).
Therefore we have,
1 3 4 9 10 12
( )=( )=( )=( )=( )=( )=1
13 13 13 13 13 13
And,
2 5 6 7 8 11
( ) = ( ) = ( ) = ( ) = ( ) = ( ) = −1.
13 13 13 13 13 13

Euler’s Criterion:
Let 𝑝 be an odd prime, 𝑎 an integer with 𝑝 ∤ 𝑎. Then
𝑎 𝑝−1
( ) = 𝑎 2 (𝑚𝑜𝑑 𝑝).
𝑝
Thus,
𝑝−1
If 𝑎 2 (𝑚𝑜𝑑 𝑝) ≡ 1 then, 𝑎 is quadratic residue of 𝑝 and
𝑝−1
If 𝑎 2 (𝑚𝑜𝑑 𝑝) ≡ −1 then, 𝑎 is quadratic nonresidue of 𝑝
Example:
Test if 8, 11, 12 are quadratic residues of 13 using Euler’s criterion.
Solution:

Page 25 of 31
𝑝−1
Here 𝑝 = 13, so = 6.
2
𝑝−1
82 = 64 ≡ −1 (𝑚𝑜𝑑 (13), so 8 2 = 86 = (82 )3 ≡ (−1)3 ≡ −1 (𝑚𝑜𝑑 𝑝).
Hence 8 is quadratic nonresidue of 13.
112 = 121 ≡ 4 (𝑚𝑜𝑑 13), so 116 ≡ (112 )3 ≡ 43 ≡ 64 ≡ −1 (𝑚𝑜𝑑 13).
Hence 11 is quadratic nonresidue of 13.
122 = 144 ≡ 1 (𝑚𝑜𝑑 13), so 126 ≡ (122 )3 ≡ 13 ≡ 1 (𝑚𝑜𝑑 13).
Hence 12 is quadratic residue of 13.

Theorem 2:
Let 𝑝 be an odd prime and 𝑎 and 𝑏 be integers which are co-prime to 𝑝. Then the
Legendre symbol has the following properties:’
𝑎 𝑏
1. If 𝑎 ≡ 𝑏 (𝑚𝑜𝑑 𝑝), then (𝑝) = (𝑝).
𝑎2 1
2. ( 𝑝 ) = 1. In particular, (𝑝) = 1.
𝑎𝑏 𝑎 𝑏
3. ( 𝑝 ) = (𝑝) (𝑝).

Corollary:
If 𝑝 is an odd prime, then
−1 1 𝑖𝑓 𝑝 ≡ 1 (𝑚𝑜𝑑 4)
( )={ .
𝑝 −1 𝑖𝑓 𝑝 ≡ 3 (𝑚𝑜𝑑 4)

For example:
−1
1. ( 43 ) = −1. Since 43 ≡ 3 (𝑚𝑜𝑑 4).
−1
2. ( 41 ) = 1. Since 41 ≡ 1 (𝑚𝑜𝑑 4).

Solve: Check whether the congruence 𝑥 2 ≡ −38 (𝑚𝑜𝑑 13) is solvable.


Solution:
−38
This can be answered by evaluating the Legendre symbol ( 13 ).

−38 −1 38 38
( ) = ( )( ) = ( )
13 13 13 13
Since 13 ≡ 1 (𝑚𝑜𝑑 4). Now 38 ≡ 12 (𝑚𝑜𝑑 13), so

Page 26 of 31
−38 38 12 22 3 3
( ) = ( ) = ( ) = ( ) ( ) = ( ).
13 13 13 13 13 13
13−1
3
But (13) = 3 2 = 36 = (33 )3 = (27)3 ≡ 13 ≡ 1 (𝑚𝑜𝑑 13).
−38
Therefore ( 13 ) = 1.

Hence 𝑥 2 ≡ −38 (𝑚𝑜𝑑 13) is solvable.

Prove that
a) 1272 is a quadratic residue of 43.
b) 319 is a quadratic residue of 7.
c) 530 is a quadratic residue of 193.
Solution:
1272 25 52
a) Here 1272 ≡ 25 (𝑚𝑜𝑑 43), so ( ) = (43) = (43) = 1.
43
319 4 22
b) Here 319 ≡ 4 (𝑚𝑜𝑑 7), so ( ) = (7) = ( 7 ) = 1.
7
530 144 122
c) Here 530 ≡ 144 (𝑚𝑜𝑑 193), so (193) = (193) = (193) = 1.

Prove that
a) 27 is a quadratic nonresidue of 31.
b) −882 is a quadratic nonresidue of 37.
Solution:
31−1
27 33 32 3 3
a) Here 27 = 33 , so (31) = (31) = (31) (31) = (31) = 3 2 ≡ 315 (𝑚𝑜𝑑 31).
Now 33 = 27 ≡ −4 (𝑚𝑜𝑑 31),
So 39 = (33 )3 ≡ (−4)3 ≡ −64 (𝑚𝑜𝑑 31) = −2 (𝑚𝑜𝑑 31).
Hence 315 = 39 33 33 ≡ (−2)(−4)(−4) ≡ −32 ≡ −1 (𝑚𝑜𝑑 31).
27
Therefore (31) = −1.
−882 −1 882 882
b) As 37 ≡ 1 (𝑚𝑜𝑑 4), so ( ) = ( 37 ) ( 37 ) = ( 37 ).
37
Now 882 ≡ 31 (𝑚𝑜𝑑 37) ≡ −6 (𝑚𝑜𝑑 37).
37−1
882 −6 −1 6 6
So ( 37 ) = ( 37 ) = ( 37 ) (37) = (37) = 6 2 (𝑚𝑜𝑑 37) = 618 (𝑚𝑜𝑑 37).
But 62 = 36 ≡ −1 (𝑚𝑜𝑑 37), so 618 = (62 )9 ≡ (−1)9 ≡ −1 (𝑚𝑜𝑑 37).
882
Therefore ( 37 ) = −1.

Page 27 of 31
Theorem 3:
If 𝑝 is an odd prime, then
2 𝑝2 −1
( ) = (−1) 8 .
𝑝
Theorem 4 (Gauss’ Quadratic Reciprocity Law):
If 𝑝 and 𝑞 are distinct odd primes, then
𝑝 𝑞 𝑝−1 𝑞−1
( ) ( ) = (−1)( 2 )( 2 ) .
𝑞 𝑝
Corollary 1:
If 𝑝 and 𝑞 are distinct odd primes, then
𝑝 𝑞 1 𝑖𝑓 𝑝 ≡ 1 (𝑚𝑜𝑑 4) 𝑜𝑟 𝑞 ≡ 1(𝑚𝑜𝑑 4)
( )( ) = { .
𝑞 𝑝 −1 𝑖𝑓 𝑝 ≡ 𝑞 ≡ 3 (𝑚𝑜𝑑 4)

Corollary 2:
If 𝑝 and 𝑞 are distinct odd primes, then
𝑞
( ) 𝑖𝑓 𝑝 ≡ 1 (𝑚𝑜𝑑 4) 𝑜𝑟 𝑞 ≡ 1(𝑚𝑜𝑑 4)
𝑝 𝑝
( )={ 𝑞 .
𝑞 − ( ) 𝑖𝑓 𝑝 ≡ 𝑞 ≡ 3 (𝑚𝑜𝑑 4)
𝑝
Evaluate the following:
29
a) (53)
71
b) (73)
3
c) (991)

Solution:
a) As both 29 and 53 are odd primes and 29 ≡ 1 (𝑚𝑜𝑑 4).
So
29 53 14 2 7 2 29
( ) = ( ) = ( ) = ( )( ) = ( )( )
53 29 29 29 29 29 7
2 1 2 292 −1
= ( ) ( ) = ( ) = (−1) 8 = (−1)105 = −1.
29 7 29

b) As both 71 and 73 are odd primes and 73 ≡ 1 (𝑚𝑜𝑑 4).


So.

Page 28 of 31
71 73 2 712 −1
( ) = ( ) = ( ) = (−1) 8 = (−1)130 = 1.
73 71 71

c) As both 111 and 3 are odd primes and 991 ≡ 3 (𝑚𝑜𝑑 4) and 3 ≡ 3 (𝑚𝑜𝑑 4).
So,
3 991 1
( ) = −( ) = − ( ) = −1.
991 3 3

Example: Determine whether there is an integer 𝑥 such that 37 divides 𝑥 2 − 31𝑥 + 34.
Solution:
This can be answered by solving
𝑥 2 − 31𝑥 + 34 ≡ 0 (𝑚𝑜𝑑 37)
𝑥 2 + 6𝑥 − 3 ≡ 0 (𝑚𝑜𝑑 37)
𝑥 2 + 6𝑥 + 12 − 3 ≡ 12 (𝑚𝑜𝑑 37)
(𝑥 + 3)2 ≡ 12 (𝑚𝑜𝑑 37)
Therefore question comes down to whether 12 is a perfect square modulo 37.
12
Which can be answered by finding the Legendre symbol (37).

12 22 3 3 37−1
( ) = ( ) ( ) = ( ) = 3 2 (𝑚𝑜𝑑 37).
37 37 37 37

But, 33 = 27 ≡ −10 (𝑚𝑜𝑑 37) and 34 = 81 ≡ 7 (𝑚𝑜𝑑 37).


So 37 ≡ −70 ≡ 4 (𝑚𝑜𝑑 37).
Therefore,
12
( ) = 318 (𝑚𝑜𝑑 37) ≡ 37 37 34 ≡ 16 × 7 ≡ 1 (𝑚𝑜𝑑 37).
37
Hence, (𝑥 + 3)2 ≡ 12 (𝑚𝑜𝑑 37) has a solution i.e., there exists an 𝑥 such that 37
divides 𝑥 2 − 31𝑥 + 34.

Page 29 of 31
Definition (Jacobi Symbol):
𝑡 𝑡 𝑡
Let 𝑛 be an odd positive integer with prime factorization 𝑛 = 𝑝11 𝑝22 … 𝑝𝑚𝑚 and let 𝑎
𝑎
be a positive integer with (𝑎, 𝑛) = 1. Then the Jacobi symbol (𝑛) is defined by

𝑎 𝑎 𝑎 𝑡1 𝑎 𝑡2 𝑎 𝑡𝑚
( ) = ( 𝑡1 𝑡2 𝑡 ) = (𝑝 ) (𝑝 ) … (𝑝 ) .
𝑛 𝑝1 𝑝2 … 𝑝𝑚𝑚 1 2 𝑚

Note:
1. When 𝑛 is prime, the Jacobi symbol is the same as the Legendre Symbol.
𝑎
2. When 𝑛 is composite, the value of (𝑛) does not tell us whether the congruence
𝑥 2 ≡ 𝑎 (𝑚𝑜𝑑 𝑛) has a solution.
For example:
32 −1 52 −1
2 2 2
i. (15) = (3) (5) = (−1) 8 (−1) 8 = (−1)(−1) = 1.
But 𝑥 2 ≡ 2 (𝑚𝑜𝑑 15) has no solution.

4 22 22
ii. (15) = ( 3 ) ( 5 ) = 1 ⋅ 1 = 1.
And the congruence 𝑥 2 ≡ 4 (𝑚𝑜𝑑 15) has a solution, namely 𝑥 = 2.
Theorem 5:
Let 𝑛 be an odd positive integer and let 𝑎 and 𝑏 be integers co-prime to 𝑛. Then
𝑎 𝑏
a) If 𝑎 ≡ 𝑏 (𝑚𝑜𝑑 𝑛), then (𝑛) = (𝑛),
𝑛−1
−1
b) ( 𝑛 ) = (−1) 2 ,
𝑛2 −1
2
c) (𝑛) = (−1) 8 .

Theorem 6:
Let 𝑛 and 𝑚 be co-prime odd positive integers. Then
𝑛 𝑚 𝑚−1 𝑛−1
( ) ( ) = (−1)( 2 )( 2 ) .
𝑚 𝑛
Evaluate the following Jacobi symbols
5
a) (21)
1009
b) (2307)
27
c) (101)
2663
d) (3299)

Page 30 of 31
111
e) (1001)
10001
f) (20003)

Solution:
5−1 7−1
5 5 5 3 5
a) (21) = (3) (7) = (5) (7) = 3 2 (𝑚𝑜𝑑 5) 5 2 (𝑚𝑜𝑑 7) = (−1)(−1) = 1.
1009 1009 1009 1 240 240
b) (2307) = ( ) ( 769 ) = (3) (769) = (769)
3
42 5 3 769 769 4 1
= (769) (769) (769) = ( )( ) = (5) (3) = 1.
5 3
3−1
27 32 3 101 2
c) (101) = (101) (101) = ( ) = (3) = 2 2 (𝑚𝑜𝑑 3) = −1.
3
2663
d) ( )=
3299

Page 31 of 31

You might also like