Unit Iii
Unit Iii
Number theory
Introduction:
The part of mathematics devoted to the study of the set of integers and their properties is
known as number theory. In this chapter we will develop some of the important concepts of
number theory including many of those used in computer science.
Number theory plays an essentially role in cryptography. Number theory has become an
essential tool in providing computer and Internet security.
Divisibility:
If 𝑎 and 𝑏 are integers with 𝑏 ≠ 0, we say that 𝑏 divides 𝑎 if there is an integer 𝑘 such
𝑏
that 𝑎 = 𝑘 × 𝑏, or equivalently, if is an integer. When 𝑏 divides 𝑎 we say that 𝑏 is a factor or
𝑎
Theorem: If 𝑎 and 𝑏 are two integers such that 𝑎 = 𝑞 𝑏 + 𝑟, then gcd 𝑎, 𝑏 = gcd 𝑏, 𝑟 .
Proof: Let gcd 𝑎, 𝑏 = 𝑑,
then 𝑑 | 𝑎 and 𝑑 | 𝑏
⟹ 𝑑 | 𝑎−𝑞𝑏 ,
i.e., 𝑑 | 𝑟 ∵ 𝑟 = 𝑎 − 𝑞𝑏 .
Therefore 𝑑 is a common divisor.
On the other hand, if 𝑐| 𝑏 and 𝑐 |𝑟
then 𝑐 | (𝑞𝑏 + 𝑟)
thus, 𝑐 | 𝑎.
Therefore 𝑐 is the common divisor of 𝑎 and 𝑏,
hence, 𝑐 | gcd 𝑎, 𝑏 , i.e., 𝑐 | 𝑑 ⟹ 𝑐 ≤ 𝑑.
Therefore 𝑑 = gcd 𝑏, 𝑟 .
Modular Arithmetic:
If 𝑎 is an integer and 𝑛 is a positive integer, we define ‘𝑎 𝑚𝑜𝑑 𝑛’ to be the remainder when
𝑎 is divided by 𝑛. The integer 𝑛 is called modulus.
For any integer 𝑎, we can write 𝑎 = 𝑞 𝑛 + 𝑟, 0≤𝑟<𝑛 (by division algorithm)
𝑎
that is, 𝑎= ∙ 𝑛 + 𝑎 𝑚𝑜𝑑 𝑛
𝑛
Congruence Modulo n :
We say a is congruent to b modulo n, and write, 𝑎 ≡ 𝑏 𝑚𝑜𝑑 𝑛 provided a and b have the
same remainder when divided by n (or (𝑎 𝑚𝑜𝑑 𝑛) = (𝑏 𝑚𝑜𝑑 𝑛)).
In other words, provided a and b belong to the same remainder class modulo n.
Many books define 𝑐𝑜𝑛𝑔𝑟𝑢𝑒𝑛𝑐𝑒 𝑚𝑜𝑑𝑢𝑙𝑜 𝑛 slightly differently. They say that 𝑎 ≡ 𝑏 (𝑚𝑜𝑑 𝑛) if
and only if 𝑛 | 𝑎 − 𝑏. In other words, two numbers are congruent modulo n, if their difference is
a multiple of n ( that is, 𝑎 − 𝑏 = 𝑘 ∙ 𝑛, for some integer 𝑘).
Properties of congruences:
Given any integers a, b, and c, and any positive integer n, the following hold:
1. 𝑎 ≡ 𝑎 (𝑚𝑜𝑑 𝑛).
2. If 𝑎 ≡ 𝑏 (𝑚𝑜𝑑 𝑛) then 𝑏 ≡ 𝑎 (𝑚𝑜𝑑 𝑛).
3. If 𝑎 ≡ 𝑏 (𝑚𝑜𝑑 𝑛) and 𝑏 ≡ 𝑐 (𝑚𝑜𝑑 𝑛), then 𝑎 ≡ 𝑐 (𝑚𝑜𝑑 𝑛).
In other words, congruence modulo n is reflexive, symmetric, and transitive, so is an equivalence
relation.
Proof:
1. For any integer 𝑎, 𝑎−𝑎 =0=0∙𝑛 ⟹ 𝑎 ≡ 𝑎 (𝑚𝑜𝑑 𝑛).
2. Let 𝑎 ≡ 𝑏 𝑚𝑜𝑑 𝑛 ⟹ 𝑎−𝑏 =𝑘∙𝑛 for some integer 𝑘.
Hence 𝑏 − 𝑎 = −𝑘𝑛 = −𝑘 𝑛
Since −𝑘 is also an integer, we can say 𝑏 ≡ 𝑎 (𝑚𝑜𝑑 𝑛).
3. Let 𝑎 ≡ 𝑏 𝑚𝑜𝑑 𝑛 then 𝑎 − 𝑏 = 𝑘1 ∙ 𝑛 for some integer 𝑘1
and 𝑏 ≡ 𝑐 𝑚𝑜𝑑 𝑛 then 𝑏 − 𝑐 = 𝑘2 ∙ 𝑛 for some integer 𝑘2
⟹ 𝑎 − 𝑐 = 𝑎 − 𝑏 + 𝑏 − 𝑐 = (𝑘1 + 𝑘2 ) ∙ 𝑛
⟹ 𝑎 ≡ 𝑐 𝑚𝑜𝑑 𝑛 .
𝑎𝜙 𝑛 𝑥1 × 𝑥2 × ⋯ × 𝑥𝜙 𝑛 ≡ (𝑥1 × 𝑥2 × ⋯ × 𝑥𝜙 𝑛 )(𝑚𝑜𝑑 𝑛)
Result: Let 𝑎, 𝑏 𝑎𝑛𝑑 𝑛 be integers with 𝑛 > 0 and gcd 𝑛, 𝑎 = 1 . Then the congruence
𝑎𝑥 ≡ 𝑏(𝑚𝑜𝑑 𝑛) has a solution that is unique modulo n.
Chinese remainder theorem: This theorem deals with the solutions of simultaneous linear
congruences.
Statement of Chinese remainder theorem:
Let 𝑛1 , 𝑛2 , … , 𝑛𝑘 be positive integers such that gcd 𝑛𝑖 , 𝑛𝑗 = 1 for 𝑖 ≠ 𝑗. Then for any
integers 𝑎1 , 𝑎2 , … , 𝑎𝑘 , the system of linear congruences
𝑥 ≡ 𝑎1 𝑚𝑜𝑑 𝑛1
𝑥 ≡ 𝑎2 𝑚𝑜𝑑 𝑛2
⋮
𝑥 ≡ 𝑎𝑘 𝑚𝑜𝑑 𝑛𝑘 has a solution.
Further more, any two solutions of the system are congruent modulo 𝑛1 𝑛2 ∙ ⋯ 𝑛𝑘 .
𝑁
Proof : Let 𝑁 = 𝑛1 × 𝑛2 ×∙ ⋯ × 𝑛𝑘 and 𝑀𝑖 = for 𝑖 = 1, 2, 3, … . , 𝑘.
𝑛𝑖
for 𝑗 = 1, 2, … , 𝑖 − 1, 𝑖 + 1, … , 𝑘.
Hence 𝑥0 = 𝑎1 𝑏1 𝑀1 + 𝑎2 𝑏2 𝑀2 + ⋯ + 𝑎𝑘 𝑏𝑘 𝑀𝑘 ≡ 𝑎𝑖 𝑏𝑖 𝑀𝑖 (𝑚𝑜𝑑 𝑛𝑖 ), for 𝑖 = 1, 2, … , 𝑘.
But, 𝑀𝑖 𝑏𝑖 ≡ 1 𝑚𝑜𝑑 𝑛𝑖
and hence, 𝑀𝑖 𝑏𝑖 𝑎𝑖 ≡ 𝑎𝑖 𝑚𝑜𝑑 𝑛𝑖
∴ 𝑥0 = 𝑎𝑖 𝑏𝑖 𝑀𝑖 𝑚𝑜𝑑 𝑛𝑖 ≡𝑎𝑖 (𝑚𝑜𝑑 𝑛𝑖 ) for 𝑖 = 1, 2, … , 𝑘
that is, 𝑥0 ≡ 𝑎1 𝑚𝑜𝑑 𝑛1
𝑥0 ≡ 𝑎2 𝑚𝑜𝑑 𝑛2
⋮
𝑥0 ≡ 𝑎𝑘 𝑚𝑜𝑑 𝑛𝑘 .
Thus 𝑥0 is a solution of the given system of congruence equations.
Further more, if 𝑥′ ≡ 𝑎𝑖 𝑚𝑜𝑑 𝑛𝑖 for 𝑖 = 1, 2, … , 𝑘
that is, 𝑥′ is also the solution of given system of congruence equations and hence
𝑥′ ≡ 𝑥0 𝑚𝑜𝑑 𝑛𝑖 for 𝑖 = 1, 2, … , 𝑘
Hence, for each 𝑖, 𝑛𝑖 | 𝑥 ′ − 𝑥0 .