Vous êtes sur la page 1sur 27

Introduction to Number

Theory
By: Dr. T. Sritharan
Modular Arithmetic
Division of an integer by a positive integer produces a quotient and a remainder.
Working with these remainders leads to modular arithmetic, which plays an
important role in mathematics and which is used throughout computer science.

Definition: Let 𝑎 and 𝑏 be two integers with 𝑎 ≠ 0. we say that 𝑎 divides 𝑏 if there
is an integer 𝑐 such that 𝑏 = 𝑎𝑐.
When 𝑎 divides 𝑏 we say that 𝑎 is a factor or divisor of 𝑏, and that 𝑏 is a multiple of
𝑎 and is denoted by 𝑎 | 𝑏.

Example: Let 𝑛 and 𝑑 be positive integers. How many positive integers not
exceeding 𝑛 are divisible by 𝑑?

5/16/2018 Dr. T. Sritharan 2


Basic Facts About Division
Theorem 1: Let 𝑎, 𝑏, and 𝑐 be integers, where 𝑎 ≠ 0. Then
1. If 𝑎|𝑏 and 𝑎|𝑐 then 𝑎|(𝑏 + 𝑐);
2. If 𝑎|𝑏 then 𝑎|𝑏𝑥 for all integers 𝑥;
3. If 𝑎|𝑏 and b|𝑐 then 𝑎|𝑐.

Corollary 2: If 𝑎, 𝑏, and 𝑐 are integers, where 𝑎 ≠ 0, such that 𝑎|𝑏 and 𝑎|𝑐, then
𝑎| 𝑚𝑏 + 𝑛𝑐 whenever 𝑚 and 𝑛 are integers.

5/16/2018 Dr. T. Sritharan 3


The Division Algorithm
Theorem 3: Let 𝑎 be an integer and 𝑑 a positive integer. Then there are unique
integers 𝑞 and 𝑟, with 0 ≤ 𝑟 < 𝑑, such that 𝑎 = 𝑑𝑞 + 𝑟.

Terminology: a – dividend d – divisor q – quotient r – remainder


Also 𝑞 = 𝑎 𝒅𝒊𝒗 𝑑 and 𝑟 = 𝑎 𝒎𝒐𝒅 𝑑.

5/16/2018 Dr. T. Sritharan 4


Modular Arithmetic
Definition: Let 𝑎, 𝑏, and 𝑚 be integers with m > 0. Then 𝑎 is congruent to 𝑏
modulo 𝑚 if 𝑚 divides 𝑎 − 𝑏 and is denoted by 𝑎 ≡ 𝑏 (𝑚𝑜𝑑 𝑚) to indicate that a is
congruent to 𝑏 modulo 𝑚.
We say that 𝑎 ≡ 𝑏 (𝑚𝑜𝑑 𝑚) is a congruence and that 𝑚 is its modulus (plural
moduli). If 𝑎 and 𝑏 are not congruent modulo 𝑚, we write 𝑎 ≢ 𝑏 (𝑚𝑜𝑑 𝑚).

Theorem 4: Let a and b be integers, and let m be a positive integer.


Then 𝑎 ≡ 𝑏 (𝑚𝑜𝑑 𝑚) if and only if 𝑎 𝑚𝑜𝑑 𝑚 = 𝑏 𝑚𝑜𝑑 𝑚.

Example: Determine whether 17 is congruent to 5 modulo 6 and whether 24 and


14 are congruent modulo 6.

5/16/2018 Dr. T. Sritharan 5


Some Basic Results
Definition: If 𝑎 ≡ 𝑏 (𝑚𝑜𝑑 𝑚), then 𝑏 is a residue of 𝑎 𝑚𝑜𝑑𝑢𝑙𝑜 𝑚. When 0 ≤ 𝑏 < 𝑚,
then b is called the least non-negative residue of a modulo m.

Theorem 5: Let 𝑚 be a positive integer. The integers 𝑎 and 𝑏 are congruent modulo 𝑚
if and only if there is an integer 𝑘 such that 𝑎 = 𝑏 + 𝑘𝑚.

Theorem 6: Let 𝑚 be a positive integer. If 𝑎 ≡ 𝑏 (𝑚𝑜𝑑 𝑚) and 𝑐 ≡ 𝑑 (𝑚𝑜𝑑 𝑚),


then
1. 𝑎 + 𝑐 ≡ 𝑏 + 𝑑 (𝑚𝑜𝑑 𝑚)
2. 𝑎𝑐 ≡ 𝑏𝑑 (𝑚𝑜𝑑 𝑚)
3. 𝑎𝑛 ≡ 𝑏𝑛 𝑚𝑜𝑑 𝑚 for any 𝑛 ≥ 1.

5/16/2018 Dr. T. Sritharan 6


Example
Note: For any 𝑎 ∈ ℤ, and 𝑚 ∈ ℤ+ , we have 𝑎 ≡ 𝑎 𝑚𝑜𝑑 𝑚 (𝑚𝑜𝑑 𝑚).

Example: Let m be a positive integer and let a and b be integers. Show


that
1. 𝑎 + 𝑏 𝑚𝑜𝑑 𝑚 = 𝑎 𝑚𝑜𝑑 𝑚 + 𝑏 𝑚𝑜𝑑 𝑚 𝑚𝑜𝑑 𝑚; and
2. 𝑎𝑏 𝑚𝑜𝑑 𝑚 = 𝑎 𝑚𝑜𝑑 𝑚 𝑏 𝑚𝑜𝑑 𝑚 𝑚𝑜𝑑 𝑚.

5/16/2018 Dr. T. Sritharan 7


Some Applications of Theorem 6
1. Calculate the least non-negative least residue of 4100 𝑚𝑜𝑑 13.
2. What are the last two digits of 1399 ?

42 ≡ 3 𝑚𝑜𝑑 13;
44 ≡ 32 ≡ 9 ≡ −4 𝑚𝑜𝑑 13;
48 ≡ −4 2 ≡ 16 ≡ 3 𝑚𝑜𝑑 13;
416 ≡ 32 ≡ 9 ≡ −4 𝑚𝑜𝑑 13;
432 ≡ −4 2 ≡ 16 ≡ 3 𝑚𝑜𝑑 13;
464 ≡ 32 ≡ 9 ≡ −4 𝑚𝑜𝑑 13;

Therefore 4100 = 464+32+4


= 464 × 432 × 44
≡ −4 × 3 × (−4)
≡ 48 ≡ 9 𝑚𝑜𝑑 13.
5/16/2018 Dr. T. Sritharan 8
Example
25
Prove that 2 is divisible by 641.

Solution: 641 = 640 + 1 = 5 × 27 + 1


⟹ 5 × 27 ≡ −1 (𝑚𝑜𝑑 641)
⟹ 5 × 27 4 ≡ −1 4 (𝑚𝑜𝑑 641)
⟹ 54 × 228 ≡ 1 (𝑚𝑜𝑑 641)
⟹ (625 𝑚𝑜𝑑 641 ) × 228 ≡ 1 (𝑚𝑜𝑑 641)
⟹ − 24 × 228 ≡ 1 (𝑚𝑜𝑑 641)
⟹ 232 ≡ −1 (𝑚𝑜𝑑 641)
25
⟹ 2 + 1 is divisible by 641.

5/16/2018 Dr. T. Sritharan 9


Arithmetic on ℤ𝒎
Let ℤ𝒎 = 𝟎, 𝟏, 𝟐, ⋯ , 𝒎 − 𝟏 , where 𝑚 is a positive integer. We can define two
arithmetic operations +𝑚 and ×𝑚 on ℤ𝒎 by

𝑎 +𝑚 b = a + b mod m
𝑎 ×𝑚 b = a × b mod m for all 𝑎, 𝑏 ∈ ℤ𝒎 .

The operations +𝑚 and ×𝑚 are called addition and multiplication modulo m and
when we use these operations, we are said to be doing arithmetic modulo m.

Example: Use the definition of addition and multiplication in ℤ𝟏𝟏 to find 8+11 9 and
7×11 9.

5/16/2018 Dr. T. Sritharan 10


Primes
Definition: An integer 𝑝 greater than 1 is called prime if the only positive factors of
𝑝 are 1 and 𝑝. A positive integer that is greater than 1 and is not prime is called
composite.

THE FUNDAMENTAL THEOREM OF ARITHMETIC: Every integer greater than 1 can


be written uniquely as a prime or as the product of two or more primes where the
prime factors are written in order of non-decreasing size.

Theorem 7: If 𝑛 is a composite integer, then 𝑛 has a prime divisor less than or


equal to 𝑛.

5/16/2018 Dr. T. Sritharan 11


The Set of all Primes is Infinite
Theorem 8: There are infinitely many primes.
Proof: We assume that there are only finitely many primes, 𝑝1 , 𝑝2 , ⋯ , 𝑝𝑛 .
Let 𝑞 = 𝑝1 𝑝2 ⋯ 𝑝𝑛 + 1.
By the fundamental theorem of arithmetic, 𝑞 is prime or else it can be written as
the product of two or more primes.
If 𝑝𝑗 divides 𝑞 for some 𝑗, then 𝑝𝑗 divides 𝑞 − 𝑝1 𝑝2 ⋯ 𝑝𝑛 = 1. Therefore, 𝑝𝑗 does
not divide 𝑞 for every 𝑗 = 1, 2, ⋯ , 𝑛.
Hence, there is a prime not in the list 𝑝1 , 𝑝2 , ⋯ , 𝑝𝑛 . This prime is either 𝑞, if it is
prime, or a prime factor of 𝑞.
This is a contradiction because we assumed that we have listed all the primes.
Consequently, there are infinitely many primes.

5/16/2018 Dr. T. Sritharan 12


Mersenne Primes
• The largest prime known has been an integer of the special form 2𝑝 − 1, where p
is also prime. Such primes are called Mersenne primes.

• 2𝑝 − 1 is prime ⟹ 𝑝 is a prime. ( 211 − 1 = 2047 = 23 × 89)

• The largest Mersenne prime number (50th) known to mankind (December 26,
2017) is 277,232,917 − 1. (This is the largest prime known).

5/16/2018 Dr. T. Sritharan 13


The Distribution of Primes
How many primes are less than a positive number x?

Theorem 9 (The Prime Number Theorem – 1896): If 𝜋(𝑥) be the number of primes
𝜋(𝑥)
less than or equal to the number x, then lim 𝑥 = 1.
𝑥→∞ ln 𝑥

• The probability that a randomly selected positive integer less than n is prime is
1
approximately ln 𝑛.
1
• The odds that an integer near 101000 is prime are approximately , which
ln 101000
is approximately 1/2300.

5/16/2018 Dr. T. Sritharan 14


Greatest Common Divisor
Definition: Let 𝑎 and 𝑏 be integers, not both zero. The largest integer 𝑑 such that
𝑑 | 𝑎 and 𝑑 | 𝑏 is called the greatest common divisor of 𝑎 and 𝑏 and is denoted by
gcd(𝑎, 𝑏).
Example: What is the greatest common divisor of 24 and 36?

Definition: The integers 𝑎 and 𝑏 are relatively prime if their greatest common
divisor is 1.
Definition: The integers 𝑎1 , 𝑎2 , ⋯ , 𝑎𝑛 are pairwise relatively prime if gcd 𝑎𝑖 , 𝑎𝑗 = 1
whenever 1 ≤ 𝑖 < 𝑗 ≤ 𝑛.
Example: Integers 17 and 22 are relatively prime, because gcd(17, 22) = 1.
Integers 10, 17, and 21 are pairwise relatively prime.

5/16/2018 Dr. T. Sritharan 15


Least Common Multiple
Definition: The least common multiple of the positive integers 𝑎 and 𝑏 is the smallest
positive integer that is divisible by both 𝑎 and 𝑏 and is denoted by 𝑙𝑐𝑚(𝑎, 𝑏).

Example: Find the gcd and 𝑙𝑐𝑚 of 150 and 500.

Theorem 10: Let 𝑎 and 𝑏 be positive integers. Then 𝑎𝑏 = 𝑔𝑐𝑑(𝑎, 𝑏) · 𝑙𝑐𝑚(𝑎, 𝑏).

5/16/2018 Dr. T. Sritharan 16


The Euclidean Algorithm
Lemma 11: Let 𝑎 = 𝑏𝑞 + 𝑟, where 𝑎, 𝑏, 𝑞, and 𝑟 are integers. Then
𝑔𝑐𝑑(𝑎, 𝑏) = 𝑔𝑐𝑑(𝑏, 𝑟).

Example: Let us compute the greatest common divisor of 945 and 2415.
2415 = 945 × 2 + 525
945 = 525 × 1 + 420
525 = 420 × 1 + 105
420 = 105 × 4 + 0.
∴ gcd 2415, 945 = 105.

Exercise: Compute gcd(803, 154)

5/16/2018 Dr. T. Sritharan 17


The Euclidean Algorithm
Suppose that 𝑎, 𝑏 ∈ ℤ+ with 𝑎 ≥ 𝑏. Let 𝑟0 = 𝑎 and 𝑟1 = 𝑏.
Successive application of the division algorithm gives
𝑟0 = 𝑟1 𝑞1 + 𝑟2 0 ≤ 𝑟2 < 𝑟1
𝑟1 = 𝑟2 𝑞2 + 𝑟3 0 ≤ 𝑟3 < 𝑟2

𝑟𝑛−2 = 𝑟𝑛−1 𝑞1 + 𝑟𝑛 0 ≤ 𝑟𝑛 < 𝑟𝑛−1
𝑟𝑛−1 = 𝑟𝑛 𝑞𝑛 .
Since 𝑎 = 𝑟𝑜 > 𝑟1 > 𝑟2 > ⋯ ≥ 0, 𝑟𝑛 = 0 for some 𝑛.
Form the above lemma, we have
gcd a, b = gcd 𝑟0 , 𝑟1 = gcd 𝑟1 , 𝑟2 = ⋯ = gcd 𝑟𝑛−2 , 𝑟𝑛−1 = gcd 𝑟𝑛−1 , 𝑟𝑛 = gcd 𝑟𝑛 , 0 = 𝑟𝑛 .
Hence, gcd(𝑎, 𝑏) is the last nonzero remainder in the sequence of divisions.

5/16/2018 Dr. T. Sritharan 18


gcds as Linear Combinations
BÉZOUT’S Theorem 12: If 𝑎 and 𝑏 are positive integers, then there exist integers 𝑠
and 𝑡 such that gcd(𝑎, 𝑏) = 𝑠𝑎 + 𝑡𝑏.
Example: Express gcd(252, 198) = 18 as a linear combination of 252 and 198.

252 = 1 × 198 + 54 18 = 54 − 1 × 36

198 = 3 × 54 + 36 = 54 − 1 198 − 3 × 54

54 = 1 × 36 + 18 = 4 × 54 − 1 × 198

36 = 2 · 18. = 4 252 − 1 × 198 − 1 × 198

∴ gcd 252, 54 = 18. = 4 × 252 − 5 × 198.

Hence gcd 252, 198 = 𝟏𝟖 = 4 × 𝟐𝟓𝟐 − 5 × 𝟏𝟗𝟖.

5/16/2018 Dr. T. Sritharan 19


Applications BÉZOUT’S Theorem
Lemma 13: If 𝑎, 𝑏, and 𝑐 are positive integers such that gcd(𝑎, 𝑏) = 1 and 𝑎|𝑏𝑐,
then 𝑎|𝑐.

Lemma 14: If 𝑝 is a prime and 𝑝|𝑎1 𝑎2 ⋯ 𝑎𝑛 , where each 𝑎𝑖 is an integer, then 𝑝|𝑎𝑖 for
some 𝑖.

Theorem 15: Let 𝑚 be a positive integer and let 𝑎, 𝑏, and 𝑐 be integers.


If 𝑎𝑐 ≡ 𝑏𝑐 (𝑚𝑜𝑑 𝑚) and gcd(𝑐, 𝑚) = 1, then 𝑎 ≡ 𝑏 (𝑚𝑜𝑑 𝑚).

5/16/2018 Dr. T. Sritharan 20


Solving Linear Congruence
A congruence of the form a𝑥 ≡ 𝑏 (𝑚𝑜𝑑 𝑚) is called a linear congruence, where
𝑎, 𝑏, 𝑚 ∈ ℤ, 𝑚 > 0, and 𝑥 is a variable.
Finding all integers x that satisfy this congruence is known as solving this linear
congruence.

If there exists an integer 𝑎′ such that 𝑎′ 𝑎 ≡ 1 𝑚𝑜𝑑 𝑚 , then 𝑎′ is said to be an inverse


of a modulo m.
Example: What are the solutions of the linear congruence 3𝑥 ≡ 4 (𝑚𝑜𝑑 7)?

Theorem 16: Let 𝑚 ≥ 2. If 𝑎 and 𝑚 are relatively prime then there exists a unique
integer 𝑎 such that 𝑎𝑎 ≡ 1 (𝑚𝑜𝑑 𝑚) and 0 < 𝑎 < m.

5/16/2018 Dr. T. Sritharan 21


Example
Find an inverse of 101 modulo 4620.

4620 = 45 · 101 + 75
101 = 1 · 75 + 26
75 = 2 · 26 + 23
26 = 1 ∙ 23 + 3
23 = 7 · 3 + 2
3 = 1 · 2 + 1
2 = 2 · 1.

5/16/2018 Dr. T. Sritharan 22


Euler 𝝋-function
Definition: The Euler 𝜑-function is the function 𝜑: ℤ+ → ℤ+ defined by
𝜑 𝑛 = the number of integers in {1, 2, . . . , n − 1} which are relatively prime to n.

Proposition 17:
• If 𝑝 is prime, 𝜑 𝑝 = 𝑝 − 1.
• If 𝑝 is prime and 𝑛 ≥ 1, then 𝜑 𝑝𝑛 = 𝑝𝑛 − 𝑝𝑛−1 .
• If gcd 𝑚, 𝑛 = 1, 𝑡ℎ𝑒𝑛 𝜑 𝑚𝑛 = 𝜑(𝑚)𝜑(𝑛).
𝑎 𝑎 𝑎
• For any integer 𝑛 > 1, if 𝑛 = 𝑝1 1 𝑝2 2 ⋯ 𝑝𝑠 𝑠 is the prime power factorization,
1 1 1
then 𝜑 𝑛 = 𝑛 1 − 𝑝 1−𝑝 ⋯ 1−𝑝 .
1 2 𝑠

Example: Find 𝜑(1000).

5/16/2018 Dr. T. Sritharan 23


Complete and Reduced residue system
Definition: For a positive integer n, a reduced residue system mod n is a set of
numbers 𝑎1 , 𝑎2 , ⋯ , 𝑎𝜑(𝑛) such that
1. If 𝑖 ≠ 𝑗 then 𝑎𝑖 ≢ 𝑎𝑗 (𝑚𝑜𝑑 𝑛)
2. For each 𝑖, gcd 𝑎𝑖 , 𝑛 = 1.

Example: {1, 5, 7, 11} is a reduced residue system mod 12. {−11, 17, 31,−1} is also
another reduced residue system for mod 12.

Definition: For a positive integer n, a complete residue system mod n is a set of


numbers 0, 1, 2, ⋯ , 𝑛 − 1 .

5/16/2018 Dr. T. Sritharan 24


Basic Results
Lemma 18: Let 𝜑 𝑛 = 𝑘, and let { 𝑎1 , 𝑎2 , ⋯ , 𝑎𝑘 } be a reduced residue system mod n.
1. For all 𝑚, { 𝑎1 +𝑚𝑛, 𝑎2 + 𝑚𝑛, ⋯ , 𝑎𝑘 + 𝑚𝑛} is a reduced residue system mod n.
2. If (𝑚, 𝑛) = 1, {𝑚𝑎1 , 𝑚𝑎2 , ⋯ , 𝑚𝑎𝑘 } is a reduced residue system mod n.

Corollary 19: Let 𝜑 𝑛 = 𝑘, and let { 𝑎1 , 𝑎2 , ⋯ , 𝑎𝑘 } be a reduced residue system mod


n. Suppose gcd 𝑠, 𝑛 = 1, and let 𝑡 be any integer.
Then { 𝑠𝑎1 +𝑡𝑛, 𝑠𝑎2 + 𝑡𝑛, ⋯ , 𝑠𝑎𝑘 + 𝑡𝑛} is a reduced residue system mod n.

5/16/2018 Dr. T. Sritharan 25


Euler Theorem
Theorem 20: (Euler) Let 𝑛 > 0, gcd(𝑎, 𝑛) = 1. Then 𝑎𝜑(𝑛) ≡ 1 (𝑚𝑜𝑑 𝑛) .

Proof: Let 𝜑 𝑛 = 𝑘, and let { 𝑎1 , 𝑎2 , ⋯ , 𝑎𝑘 } be a reduced residue system mod n.


We may assume that the 𝑎𝑖 ’s lie in the range {1, . . . , 𝑛 − 1}.

Since gcd 𝑎, 𝑛 = 1, { 𝑎𝑎1 , 𝑎𝑎2 , ⋯ , 𝑎𝑎𝑘 }, is another reduced residue system mod n.
Since this is the same set of numbers mod n as the original system, the two systems
must have the same product mod n:
𝑎𝑎1 × 𝑎𝑎2 × ⋯ × 𝑎𝑎𝑘 ≡ 𝑎1 × 𝑎2 × ⋯ × 𝑎𝑘 (𝑚𝑜𝑑 𝑛)
⟹ 𝑎𝑘 𝑎1 × 𝑎2 × ⋯ × 𝑎𝑘 ≡ 𝑎1 × 𝑎2 × ⋯ × 𝑎𝑘 𝑚𝑜𝑑 𝑛
⟹ 𝑎𝑘 ≡ 1 𝑚𝑜𝑑 𝑛 ∵ gcd 𝑎𝑖 , 𝑛 = 1 & applying theorem 12 .

That is; 𝑎𝜑(𝑛) ≡ 1 (𝑚𝑜𝑑 𝑛) .

5/16/2018 Dr. T. Sritharan 26


Applications of Euler’s Theorem
Theorem 21 (Fermat's Little Theorem): Let p be any prime number and suppose
that p does not divide a. Then
𝑎𝑝−1 ≡ 1 𝑚𝑜𝑑 𝑝 .

Example 1: Find 916 𝑚𝑜𝑑 40.


𝜑 40 = 16 , and gcd 9,40 = 1. Hence by Euler’s Theorem 916 ≡ 1 (𝑚𝑜𝑑 40).

Example 2: Find 7222 𝑚𝑜𝑑 11.

Example 3: Solve 15𝑥 ≡ 7 (𝑚𝑜𝑑 32).

5/16/2018 Dr. T. Sritharan 27

Vous aimerez peut-être aussi