Location via proxy:   [ UP ]  
[Report a bug]   [Manage cookies]                
0% found this document useful (0 votes)
54 views

Number Theory

Uploaded by

sachetan2005
Copyright
© © All Rights Reserved
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
54 views

Number Theory

Uploaded by

sachetan2005
Copyright
© © All Rights Reserved
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 18

Department of Mathematics

UNIT-I
NUMBER THEORY
Topic Learning Objectives:

Upon completion of this unit, students will be able to:


• Find quotients and remainders from integer division.
• Apply Euclid’s algorithm and backwards substitution.
• Understand the definitions of congruences, residue classes and least residues.
• Add and subtract integers, modulo 𝑛, multiply integers and calculate powers,
modulo 𝑛.
• Determine multiplicative inverses, modulo 𝑛 and use to solve linear congruences.
• Apply to Encryption and Decryption.

Introduction
Number theory is the study of natural or counting numbers, including prime numbers.
Number theory is important because the simple sequence of counting numbers from one to
infinity conceals many relationships beneath its surface.

Number theory is an immensely rich area and it is defined by the important problems that it
tries to solve. Sometimes a problem was considered solved, but years later the solution was
found to be flawed. One important challenge in number theory has been trying to find a
formula that will describe all the prime numbers. To date, that problem has not been solved.

One of Gauss's most important contributions to number theory involved the invention of the
idea of congruence in numbers and the use of what he called "modulo" or small measures
or sets of numbers. In effect, his theory of congruence allows people to break up the infinite
series of whole numbers into smaller, more manageable chunks of numbers and perform
computations upon them. This arrangement makes the everyday arithmetic involved in such
things as telling time much easier to program into computers.

Prime and composite numbers play an important role in modern cryptography or coding
systems. Huge volumes of confidential and large amounts of money are transferred
electronically around the world every day, all of which must kept secret. One of the
important applications of number theory is keeping secrets.

second Semester 1 Number theory (22MA21C)


Department of Mathematics

This time gap between finding out if a number is prime and factoring the primes in a
composite number is useful to cryptographers. To create a security system, they invent
numerical codes for the letters and characters of a message.

Number theory: a huge, ancient, complex, and above all, beautiful branch of mathematics.
Historically, number theory was known as the Queen of Mathematics and was very much a
branch of pure mathematics, studied for its own sake instead of understanding real world
applications. This has changed in recent years however, as applications of number theory
have been unearthed. Probably the most well-known example of this is RSA cryptography,
one of the methods used in encrypting data on the internet. It is number theory that makes
this possible.

Divisibility
If 𝑎 and 𝑏 are integers such that 𝑎 ≠ 0, then we say “𝑎 divides 𝑏” if there exists an integer
𝑘 such that 𝑏 = 𝑘𝑎.

If 𝑎 divides 𝑏, we also say “𝑎 is a factor of 𝑏” or “𝑏 is a multiple of 𝑎” and we write 𝑎|𝑏. If


𝑎 doesn’t divide 𝑏, we write 𝑎 ⫮ 𝑏. For example, 2|4 and 7|63, while 5 ⫮ 26.

Note that any even integer has the form 2𝑘 for some integer 𝑘, while any odd integer has
the form 2𝑘 + 1 for some integer 𝑘. Thus 2|𝑛 if 𝑛 is even, while 2 ⫮ 𝑛 if 𝑛 is odd.

Elementary properties:
1. If 𝑎 is any non-zero integer, then 𝑎|𝑎 and 𝑎|0.

2. If 𝑎|𝑏, then 𝑎| − 𝑏,−𝑎|𝑏 and −𝑎| − 𝑏.

3. If 𝑎 is any integer, then 1|𝑎 and −1|𝑎.

4. Only divisors of 1 are 1 and −1.

5. Only divisors of −1 are 1 and −1.

Properties:
(1) If a and b are non-zero integers such that 𝑎|𝑏 and 𝑏|𝑎, then 𝑎 = ±𝑏.

Proof: 𝑎|𝑏 ⇒ 𝑏 = 𝑎𝑘1 (1) where 𝑘1 ∈ 𝑍

𝑏|𝑎 ⇒ 𝑎 = 𝑏𝑘2 (2) where 𝑘2 ∈ 𝑍

Multiplying (1) and (2), we get

𝑏𝑎 = (𝑘1 𝑘2 )𝑎𝑏

second Semester 2 Number theory (22MA21C)


Department of Mathematics

⇒ 𝑘1 𝑘2 = 1

As 𝑘1 and 𝑘2 are integers, 𝑘1 𝑘2 = 1 ⇒ 𝑘1 = 𝑘2 = 1 or 𝑘1 = 𝑘2 = −1

Thus 𝑎 = 𝑏 or 𝑎 = −𝑏

∴ 𝑎 = ±𝑏

(2) If 𝑎|𝑏 and 𝑏|𝑐 then 𝑎|𝑐 (transitive law)

Proof: 𝑎|𝑏 ⇒ 𝑏 = 𝑎𝑘1 (1) where 𝑘1 ∈ 𝑍

𝑏|𝑐 ⇒ 𝑐 = 𝑏𝑘2 (2) where 𝑘2 ∈ 𝑍

(1) and (2) gives 𝑐 = 𝑘1 𝑘2 𝑎

⇒ 𝑐 = 𝑘3 𝑎 where 𝑘3 = 𝑘1 𝑘2 ∈ 𝑍

∴ 𝑎|𝑐.

(3) If 𝑎|𝑏 and 𝑎|𝑐 then (i) 𝑎|𝑏 + 𝑐 (ii) 𝑎|𝑏 − 𝑐 (iii) 𝑎|𝑏𝑐

Proof: 𝑎|𝑏 ⇒ 𝑏 = 𝑎𝑘1 (1) where 𝑘1 ∈ 𝑍

𝑎|𝑐 ⇒ 𝑐 = 𝑎𝑘2 (2) where 𝑘2 ∈ 𝑍

(i) Adding (1) and (2), 𝑏 + 𝑐 = (𝑘1 + 𝑘2 )𝑎

∴ 𝑎|𝑏 + 𝑐

(ii) Subtracting (1) and (2), 𝑏 − 𝑐 = (𝑘1 − 𝑘2 )𝑎

∴ 𝑎|𝑏 − 𝑐

(iii) Multiplying (1) and (2),

𝑏𝑐 = (𝑘1 𝑘2 )𝑎2 ⇒ 𝑏𝑐 = (𝑘1 𝑘2 𝑎)𝑎

∴ 𝑎|𝑏𝑐

(4) If 𝑎|𝑏 and x is any integer, then 𝑎|𝑏𝑥.

Proof: 𝑎|𝑏 ⇒ 𝑏 = 𝑘𝑎 where 𝑘 ∈ 𝑍

Multiplying both sides by x, we get

𝑏𝑥 = 𝑘𝑎𝑥 = (𝑘𝑥)𝑎

∴ 𝑎|𝑏𝑥

second Semester 3 Number theory (22MA21C)


Department of Mathematics

(5) If 𝑎|𝑏 and 𝑐|𝑑, then 𝑎𝑐|𝑏𝑑.

Proof: 𝑎|𝑏 ⇒ 𝑏 = 𝑎𝑘1 (1) where 𝑘1 ∈ 𝑍

𝑐|𝑑 ⇒ 𝑑 = 𝑐𝑘2 (2) where 𝑘2 ∈ 𝑍

Multiplying (1) and (2), we get

𝑏𝑑 = (𝑘1 𝑎)(𝑘2 𝑐) ⇒ 𝑏𝑑 = (𝑘1 𝑘2 )𝑎𝑐

𝑏𝑑 = 𝑘3 𝑎𝑐 where 𝑘3 = 𝑘1 𝑘2 ∈ 𝑍

∴ 𝑎𝑐|𝑏𝑑.

(6) If 𝑎𝑐|𝑏𝑐, then 𝑎|𝑏. (𝑐 ≠ 0)

Proof: 𝑎𝑐|𝑏𝑐 ⇒ 𝑏𝑐 = 𝑘𝑎𝑐 where 𝑘 ∈ 𝑍

On dividing by 𝑐,

𝑏 = 𝑘𝑎 where 𝑘 ∈ 𝑍

∴ 𝑎|𝑏.

Division algorithm
The division algorithm, despite its name, it is not really an algorithm. It states that when
you divide two numbers, there is a unique quotient and remainder. Specifically, it says the
following:

Theorem: Let 𝑎, 𝑏 ∈ 𝑍 with 𝑏 > 0. Then there exist unique 𝑞, 𝑟 ∈ 𝑍 such that 𝑎 = 𝑏𝑞 +
𝑟 and 0 ≤ 𝑟 < 𝑏.
The integers 𝑞 and 𝑟 are called the quotient and remainder respectively.
For example, if 𝑎 = 27 and 𝑏 = 7, then 𝑞 = 3 and 𝑟 = 6. That is, 27 ÷ 7 is 3 with a
remainder of 6, or in equation form: 27 = 7 × 3 + 6.

The Greatest Common Divisor


In this section we define the greatest common divisor (GCD) of two integers and discuss its
properties. We also prove that the greatest common divisor of two integers is a linear
combination of these integers.
Two integers 𝑎 and 𝑏, not both 0, can have only finitely many divisors, and thus can have
only finitely many common divisors. In this section, we are interested in the greatest
common divisor of 𝑎 and 𝑏. Note that the divisors of 𝑎 and that of | 𝑎 | are the same.
second Semester 4 Number theory (22MA21C)
Department of Mathematics

Definition: The greatest common divisor of two integers 𝑎 and 𝑏 is the greatest integer
that divides both 𝑎 and 𝑏.
We denote the greatest common divisor of two integers 𝑎 and 𝑏 by 𝑔𝑐𝑑(𝑎, 𝑏) or (𝑎, 𝑏).

Example: Note that the greatest common divisor of 24 and 18 is 6. In other words
𝑔𝑐𝑑(24, 18) = 6.
There are integers (e.g. 3 and 4, etc.) whose greatest common divisor is 1 so we call such
integers relatively prime integers.

Definition: Two integers 𝑎 and 𝑏 are relatively prime if 𝑔𝑐𝑑(𝑎, 𝑏) = 1.

Example: The greatest common divisor of 9 and 16 is 1, thus they are relatively prime.
Note that every integer has positive and negative divisors. If 𝑎 is a positive divisor of 𝑚,
then −𝑎 is also a divisor of 𝑚 . Therefore, by our definition of the greatest common
divisor, we can see that 𝑔𝑐𝑑(𝑎, 𝑏) = 𝑔𝑐𝑑(| 𝑎 |, | 𝑏 |).
We now present a theorem about the greatest common divisor of two integers. The theorem
states that if we divide two integers by their greatest common divisor, then the outcome is a
couple of integers that are relatively prime.

NOTE:
1. If ′𝑎′ is a non-zero integer, then 𝑔𝑐𝑑(𝑎, 0) = 𝑎.
𝑎 𝑏
2. If 𝑔𝑐𝑑(𝑎, 𝑏) = 𝑑 then 𝑔𝑐𝑑 (𝑑 , 𝑑) = 1

3. If 𝑔𝑐𝑑(𝑎, 𝑏) = 𝑑 and 𝑚 is any positive integer, then 𝑔𝑐𝑑(𝑚𝑎, 𝑚𝑏) = 𝑚𝑑.

The Euclidean Algorithm


In this section we describe a systematic method that determines the greatest common
divisor of two integers. This method is called the Euclidean algorithm.
The two numbers 𝑎 and 𝑏 can be assumed as positive. Let 𝑎 < 𝑏. 𝑏 is divided by 𝑎 and let
𝑟1 be the remainder. Then 0 ≤ 𝑟1 < 𝑎. Now 𝑎 is divided by 𝑟1 and the remainder obtained
is taken as 𝑟2 , then 0 ≤ 𝑟2 < 𝑟1. Again 𝑟1 is divided by 𝑟2 and the remainder obtained is 𝑟3 .

second Semester 5 Number theory (22MA21C)


Department of Mathematics

Continuing this process of dividing each divisor by the next remainder, at some stage 0
remainder is obtained. The last non zero remainder is the GCD of 𝑎 and 𝑏. This is known as
Euclid’s algorithm method.
Now to express the GCD as 𝑎𝑥 + 𝑏𝑦, the successive divisors are as follows
𝑎) 𝑏 (𝑞
𝑞𝑎
________ 𝑟1 = 𝑏 − 𝑞𝑎 (1)
𝑏 − 𝑞𝑎 = 𝑟1
𝑟1 ) 𝑎(𝑞1
𝑞1 𝑟1
___________ 𝑟2 = 𝑎 − 𝑞1 𝑟1 (2)
𝑎 − 𝑞1 𝑟1 =𝑟2
𝑟2 ) 𝑟1 (𝑞2
𝑞2 𝑟2
___________ 𝑟3 = 𝑟1 − 𝑞2 𝑟2 (3)
𝑟1 − 𝑞2 𝑟2=𝑟3
The process is continued till the remainder is 0. Similarly, the following equations are
obtained.
𝑟4 = 𝑟2 − 𝑞3 𝑟3 (3)


𝑟𝑛−2 = 𝑟𝑛−4 − 𝑞𝑛−3 𝑟𝑛−3
𝑟𝑛−1 = 𝑟𝑛−3 − 𝑞𝑛−2 𝑟𝑛−2
𝑟𝑛 = 𝑟𝑛−2 − 𝑞𝑛−1 𝑟𝑛−1
Next remainder 𝑟𝑛+1 becomes 0.
∴ GCD of 𝑎 and 𝑏 is 𝑟𝑛 .

Example: Find the greatest common divisor of 4147 and 10672:


Solution:
10672 = 4147 × 2 + 2378
4147 = 2378 × 1 + 1769
2378 = 1769 × 1 + 609
1769 = 609 × 2 + 551
second Semester 6 Number theory (22MA21C)
Department of Mathematics

609 = 551 × 1 + 58
551 = 58 × 9 + 29
58 = 29 × 2
Hence (4147,10672) = 29

We now use the steps in the Euclidean algorithm to write the greatest common divisor of
two integers as a linear combination of the two integers. The following example will
determine the variables 𝑚 and 𝑛. The following algorithm can be described by a general
form but for the sake of simplicity of expressions we will present an example that shows
the steps for obtaining the greatest common divisor of two integers as a linear combination
of the two integers.
Example: Express 29 as a linear combination of 4147 and 10672:
Solution: 29 = 551 − 9 × 58
29 = 551 − 9(609 − 551 × 1)
= (10 × 551) − (9 × 609)
= 10 × (1769 − 609 × 2) − 9 × 609
= 10 × 1769 − (29 × 609)
= 10 × 1769 − 29(2378 − 1769)
= 39 × 1769 − (29 × 2378)
= 39 × (4147 − 2378 × 1) − 29
= 39 × 4147 − (68 × 2378)
= 39 × 4147 − 68(10672 − 4147)
29 = 175 × 4147 − (68 × 10672)
As a result, we see that 29 = 175 × 4147 − 68 × 10672.

Exercises:
1. By using the Euclidean algorithm, find the greatest common divisor 𝑑 of 1769 and 2378
and then find integers 𝑥 and 𝑦 to satisfy 1769𝑥 + 2378𝑦 = 𝑑. Also show that 𝑥 and 𝑦 are
not unique.

second Semester 7 Number theory (22MA21C)


Department of Mathematics

2. By using the Euclidean algorithm, find the greatest common divisor 𝑑 of 2689 and 4001
and then find integers 𝑥 and 𝑦 to satisfy 2689𝑥 + 4001𝑦 = 𝑑. Also show that 𝑥 and 𝑦 are
not unique.

3. Find the greatest common divisor 𝑑 of the numbers 1819 and 3587 using Euclid’s
algorithm and then find integers 𝑥 and 𝑦 to satisfy 1819𝑥 + 3587𝑦 = 𝑑.

Answers:
1. 𝐺𝐶𝐷(1769,2378) = 29 and 29 = 1769𝑥 + 2378𝑦 where 𝑥 = 39 and 𝑦 = −29

2. 𝐺𝐶𝐷(2689,4001) = 1 and 1 = 2689𝑥 + 4001𝑦 where 𝑥 = 1662 and 𝑦 = −1117

3. 𝐺𝐶𝐷(1819,3587) = 17 and 17 = 1819𝑥 + 3587𝑦 where 𝑥 = 71 and 𝑦 = −36

Prime Numbers
Prime numbers, the building blocks of integers, have been studied extensively over the
centuries. Being able to present an integer uniquely as product of primes is the main reason
behind the whole theory of numbers and behind the interesting results in this theory. Many
interesting theorems, applications and conjectures have been formulated based on the
properties of prime numbers.

Definition: A prime is an integer greater than 1 that is only divisible by 1 and itself.

Example: The integers 2, 3, 5, 7, 11 are prime integers.


Note1: Any integer greater than 1 that is not prime is said to be a composite number.
Note2: 0 and 1 are neither prime nor composite.
Note3: Every composite number can be expressed as the product of prime factors.

Example: 45 can be expressed as


45 = 3 × 3 × 5 = 32 × 5
408 = 2 × 2 × 2 × 3 × 17 = 23 × 3 × 17

second Semester 8 Number theory (22MA21C)


Department of Mathematics

Number of positive divisors and sum of positive divisors of a positive integer:


Let 𝑎 be an integer. Suppose prime factorization of 𝑎 is:
𝑎 𝑎 𝑎 𝑎
𝑎 = 𝑝1 1 𝑝2 2 𝑝3 3 ⋯ 𝑝𝑛 𝑛 .
The number of all positive divisors of a, denoted by 𝜏(𝑎), is given by,
𝜏(𝑎) = (1 + 𝑎1 )(1 + 𝑎2 ) ⋯ (1 + 𝑎𝑛 ).
The sum of all positive divisors of a, denoted by 𝜎(𝑎), is given by,
𝑎 +1 𝑎 +1 𝑎 +1
𝑝1 1 −1 𝑝2 2 −1 𝑝𝑛𝑛 −1
𝜎(𝑎) = ( )( )⋯( ).
𝑝1 −1 𝑝2 −1 𝑝𝑛 −1

Example: Find the number and sum of all positive divisors of 960.
Solution: 960 = 26 × 3 × 5
∴ 𝑝1 = 2, 𝑝2 = 3, 𝑝3 = 5, 𝑎1 = 6, 𝑎2 = 1, 𝑎3 = 1
𝜏(960) = (1 + 𝑎1 )(1 + 𝑎2 )(1 + 𝑎3 )
𝜏(960) = (1 + 6)(1 + 1)(1 + 1)=28.
𝑎 +1 𝑎 +1 𝑎 +1
𝑝1 1 − 1 𝑝2 2 − 1 𝑝𝑛 3 − 1
𝜎(960) = ( )( )( )
𝑝1 − 1 𝑝2 − 1 𝑝3 − 1
26+1 − 1 36+1 − 1 56+1 − 1
𝜎(960) = ( )( )( )
2−1 3−1 5−1
𝜎(960) = (127)(4)(6) = 3048

Properties of prime numbers


(1) The smallest positive divisor (> 1) of any integer 𝑎 > 1 is always a prime number.
(2) There are infinitely many primes OR The number of prime numbers is infinite.
(3) If c and a are relatively prime and 𝑐|𝑎𝑏 then 𝑐|𝑏.
(4) If p is a prime number and 𝑝|𝑎𝑏 where 𝑎 and 𝑏 are any integers, then either p|𝑎 or 𝑝|𝑏.
(5) If there exist integers x and y such that 𝑎𝑥 + 𝑏𝑦 = 1, then (𝑎, 𝑏) = 1.
(6) If (𝑎, 𝑏) = 1 and (𝑎, 𝑐) = 1, then (𝑎, 𝑏𝑐) = 1.
(7) If p is prime and a is any integer then either (𝑝, 𝑎) = 1 𝑜𝑟 𝑝|𝑎.
(8) The smallest positive divisor (>1) of a composite number a does not exceed √𝑎.

second Semester 9 Number theory (22MA21C)


Department of Mathematics

Exercises
1. Find the number of positive divisors and sum of all positive divisors of 1363.
2. Find the number of positive divisors and sum of all positive divisors of 8128.
3. Check whether 853 is a prime number or not?
4. Prove that there are infinitely many primes.
5. If p is a prime number and 𝑝|𝑎𝑏 where 𝑎 and 𝑏 are any integers, then prove that either
p|𝑎 or 𝑝|𝑏.

Answers:
1. Number of divisors = 4
Sum of divisors = 1440
2. Number of divisors = 14
Sum of divisors = 16256
3. 853 is a prime number.

The Fundamental Theorem of Arithmetic


Theorem: The Fundamental Theorem of Arithmetic states that every positive integer
different from 1 can be written uniquely as a product of primes.

Example: 99 = 3 × 3 × 11 = 32 × 11,
32 = 2 × 2 × 2 × 2 × 2 = 25 .

Congruences
Congruence is nothing more than a statement about divisibility. The theory of congruences
was introduced by Carl Friedrich Gauss. Gauss contributed to the basic ideas of
congruences and proved several theorems related to this theory. We start by introducing
congruences and their properties.

Definition: Let 𝑚 be a positive integer. We say that 𝑎 is congruent to 𝑏 modulo 𝑚 if


𝑚 | (𝑎 − 𝑏) where 𝑎 and 𝑏 are integers, i.e. if 𝑎 = 𝑏 + 𝑘𝑚 where 𝑘 ∈ 𝑍.
If 𝑎 is congruent to 𝑏 modulo 𝑚, we write 𝑎 ≡ 𝑏(𝑚𝑜𝑑 𝑚).
second Semester 10 Number theory (22MA21C)
Department of Mathematics

Example 1: 19 ≡ 5(𝑚𝑜𝑑 7).


Example 2: 2𝑘 + 1 ≡ 1(𝑚𝑜𝑑 2) which means every odd number is congruent to 1
modulo 2.
There are many common properties between equations and congruences. Some properties
are listed in the following theorem.

Theorem: Let a, b, c and d denotes integers. Let m be positive integers. Then:


1. If 𝑎 ≡ 𝑏(𝑚𝑜𝑑 𝑚), then 𝑏 ≡ 𝑎(𝑚𝑜𝑑 𝑚).
2. If 𝑎 ≡ 𝑏(𝑚𝑜𝑑 𝑚) and 𝑏 ≡ 𝑐(𝑚𝑜𝑑 𝑚), then 𝑎 ≡ 𝑐(𝑚𝑜𝑑 𝑚).
3. If 𝑎 ≡ 𝑏(𝑚𝑜𝑑 𝑚), then 𝑎 + 𝑐 ≡ 𝑏 + 𝑐(𝑚𝑜𝑑 𝑚).
4. If 𝑎 ≡ 𝑏(𝑚𝑜𝑑 𝑚), then 𝑎 − 𝑐 ≡ 𝑏 − 𝑐(𝑚𝑜𝑑 𝑚).
5. If 𝑎 ≡ 𝑏(𝑚𝑜𝑑 𝑚), then 𝑎𝑐 ≡ 𝑏𝑐(𝑚𝑜𝑑 𝑚).
6. If 𝑎 ≡ 𝑏(𝑚𝑜𝑑 𝑚), then 𝑎𝑐 ≡ 𝑏𝑐(𝑚𝑜𝑑 𝑚𝑐), for 𝑐 > 0.
7. If 𝑎 ≡ 𝑏(𝑚𝑜𝑑 𝑚) and 𝑐 ≡ 𝑑(𝑚𝑜𝑑 𝑚) then 𝑎 + 𝑐 ≡ (𝑏 + 𝑑)(𝑚𝑜𝑑 𝑚).
8. If 𝑎 ≡ 𝑏(𝑚𝑜𝑑 𝑚) and 𝑐 ≡ 𝑑(𝑚𝑜𝑑 𝑚) then 𝑎 − 𝑐 ≡ (𝑏 − 𝑑)(𝑚𝑜𝑑 𝑚).
9. If 𝑎 ≡ 𝑏(𝑚𝑜𝑑 𝑚) and 𝑐 ≡ 𝑑(𝑚𝑜𝑑 𝑚) then 𝑎𝑐 ≡ 𝑏𝑑(𝑚𝑜𝑑 𝑚).

Example 1: Compute 6100 modulo 7


Solution: We have 6 ≡ −1 (𝑚𝑜𝑑 7)
So 6100 ≡ (−1)100 (𝑚𝑜𝑑 7)
6100 ≡ 1 (𝑚𝑜𝑑 7).
Example 2: Compute 2100 modulo 7
Solution: 23 ≡ 1 (𝑚𝑜𝑑 7)
Further, we can write 100 = 3 × 33 + 1
Thus we have 2100 = 2 × (23 )33
2100 ≡ 2 × (23 )33 ≡ 2 × 133 ≡ 2 (𝑚𝑜𝑑 7).
Example 3: Find the remainder when 223 is divided by 47
Solution: 28 = 256 ≡ 21(𝑚𝑜𝑑 47)
∴ (28 )2 ≡ (21)2 (𝑚𝑜𝑑 47)
216 ≡ 441(𝑚𝑜𝑑 47)
second Semester 11 Number theory (22MA21C)
Department of Mathematics

216 ≡ 18 (𝑚𝑜𝑑 47) ……..(1)


27 = 128 ≡ 34(𝑚𝑜𝑑 47) ……..(2)
Multiplying (1) and (2). We get
216 × 27 ≡ 18 × 34(𝑚𝑜𝑑 47)
223 ≡ 612(𝑚𝑜𝑑 47)
223 ≡ 1(𝑚𝑜𝑑 47)
∴ the remainder is 1.

Exercises
1. Determine the remainder when 53103 + 10353 is divisible by 39.
2. Find the remainder obtained when 135 × 74 × 48 is divided by 7
3. What is the remainder in the division of 250 by 7

Answers
1. 0
2. 6
3. 4

Linear congruence:
A congruence of the form 𝑎𝑥 ≡ 𝑏(𝑚𝑜𝑑 𝑚), where 𝑥 is an unknown integer, is called a
linear congruence in one variable.

(i) If (𝑎, 𝑚) = 1, then the above congruence has a unique solution

(ii) If (𝑎, 𝑚) = 𝑑 and 𝑑|𝑏 then the above congruence has 𝑑 incongruent solutions

(iii) If (𝑎, 𝑚) = 𝑑 and 𝑑 ⫮ 𝑏 then the above congruence has no solution

Example 1: Solve 4𝑥 ≡ 5(𝑚𝑜𝑑 12)

Solution: This congruence has no solution because

4𝑥 ≡ 5(𝑚𝑜𝑑 12)

second Semester 12 Number theory (22MA21C)


Department of Mathematics

⇒ 12|4𝑥 − 5
⇒ 4𝑥 − 5 = 12𝑘

12𝑘 + 5
⇒𝑥=
4
5
⇒ 𝑥 = 3𝑘 + 4, where 𝑘 ∈ 𝑍

This means 𝑥 can never be an integer.

Example 2: Solve 12𝑥 ≡ 6(𝑚𝑜𝑑 3)

Solution: This congruence has three incongruent solutions

𝑥 ≡ 0(𝑚𝑜𝑑 3)

𝑥 ≡ 1(𝑚𝑜𝑑 3)

𝑥 ≡ 2(𝑚𝑜𝑑 3)

They are incongruent because 0 ≢ 1 ≢ 2(𝑚𝑜𝑑 3).

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

Solution: This congruence has unique solution because

7𝑥 ≡ 9(𝑚𝑜𝑑 15)

⇒ 15|7𝑥 − 9
⇒ 7𝑥 − 9 = 15𝑘
15𝑘+9
⇒𝑥= 7
, where 𝑘 ∈ 𝑍

By inspection 𝑘 = 5 gives 𝑥 = 12.

∴ 𝑥 ≡ 12(𝑚𝑜𝑑 15)

Exercises
1. Examine if the linear congruence 7𝑥 ≡ 13(𝑚𝑜𝑑 24) has unique solution, and hence
solve it.

2. If 2𝑥 ≡ 3(𝑚𝑜𝑑 7), find 𝑥 such that 9 ≤ 𝑥 ≤ 30.


3. Examine if the linear congruence 3𝑥 ≡ 2(𝑚𝑜𝑑 10) has unique solution, and hence solve
it.

second Semester 13 Number theory (22MA21C)


Department of Mathematics

Answers
1. 𝑥 ≡ 19(𝑚𝑜𝑑 24), the congruence has unique solution.

2. 𝑥 = 12,19,26
3. 𝑥 ≡ 4(𝑚𝑜𝑑 10), the congruence has unique solution.

Multiplicative inverse modulo 𝒎


A multiplicative inverse of 𝑎 modulo 𝑚 is an integer 𝑣 such that 𝑎𝑣 ≡ 1(𝑚𝑜𝑑 𝑚).

For example: 5 is a multiplicative inverse of 2 modulo 9 because 2 × 5 ≡ 1 (𝑚𝑜𝑑 9).

Euler phi function or Euler totient function


The number 𝜙(𝑚) is the number of positive integers less than or equal to 𝑚 that are
relatively prime to 𝑚.

𝜙 is called Euler’s – phi function or totient.

Properties

1. If 𝑝 is a prime number then 𝜙(𝑝) = 𝑝 − 1

2. If 𝑝 is a prime number and 𝑘 > 0, then 𝜙(𝑝𝑘 ) = 𝑝𝑘 − 𝑝𝑘−1


𝑘 𝑘 𝑘
3. If the integer 𝑛 > 1 has the prime factorization 𝑛 = 𝑝1 1 × 𝑝2 2 × ⋯ × 𝑝𝑟 𝑟 then

1 1 1
𝜙(𝑛) = 𝑛 (1 − ) (1 − ) ⋯ (1 − )
𝑝1 𝑝2 𝑝𝑟

Example1: 𝜙(5) = 4.

1,2,3 and 4 are relatively prime to 5

Example 2: 𝜙(9) = 𝜙(32 ) = 32 − 3 = 6.

1,2,4,5,7,8 are relatively prime to 9.

Example 3: Calculate 𝜙(360)

𝜙(360) = 𝜙(23 32 5)

1 1 1
𝜙(360) = 360 (1 − ) (1 − ) (1 − ) = 96
2 3 5
second Semester 14 Number theory (22MA21C)
Department of Mathematics

Euler's Theorem
Euler's theorem states that if (𝑎, 𝑚) = 1, then 𝑎𝜙(𝑚) ≡ 1 (𝑚𝑜𝑑 𝑚).

Example1: Find the last digit of 555 .

Solution: We note that 𝑔𝑐𝑑(10, 55) = 5, and hence this pair is not relatively prime,
however, we know that 55 has a prime power decomposition of 55 = 5 × 11.

𝑔𝑐𝑑(11, 10) = 1, hence it follows that

11𝜙(10) ≡ 1 (𝑚𝑜𝑑 10). We note that 𝜙(10) = 4. Hence 114 ≡ 1 (𝑚𝑜𝑑 10), and more
appropriately 555 = 55 . 115 = 55 . 114 . 11 ≡ 55 . (1)4 . 11 ≡ 34375 ≡ 5 (𝑚𝑜𝑑 10)

Hence the last digit of 555 is 5.

Example 2: Find the last two digits of 33334444 .

Solution: We first note that finding the last two digits 33334444 can be obtained by
reducing 33334444 (𝑚𝑜𝑑 100). Since 𝑔𝑐𝑑(3333, 100) = 1, we can apply Euler’s theorem.
1 1
We first calculate that 𝜙(100) = 𝜙(22 × 52 ) = 100 (1 − 2) (1 − 5) = 40.

Hence it follows from Euler's theorem that 333340 ≡ 1 (𝑚𝑜𝑑 100).

Let's apply the division algorithm on 4444 and 40 as follows:

4444 = 40(111) + 4

Hence it follows that:

33334444 ≡ (333340 )111 . 33334 ≡ (1)111 . 33334 (𝑚𝑜𝑑 100)

33334444 ≡ 33 × 33 × 33 × 33 (𝑚𝑜𝑑 100)

33334444 ≡ 334 (𝑚𝑜𝑑 100) = 1185921(𝑚𝑜𝑑 100)

33334444 ≡ 21 (𝑚𝑜𝑑 100)

Hence the last two digits of 33334444 are 2 and 1.

second Semester 15 Number theory (22MA21C)


Department of Mathematics

Cryptography
In the age of the internet, when we use the internet to conduct business transactions, check
our bank account, use credit cards to buy things online, and take cash out of an ATM,
security technologies such as armed guards and X-ray machines simply don’t work. The
danger with modern internet transactions is that you must send private data through a public
network in order to reach its destination, such as your bank. The problem with this is that
anyone can intercept read the message you have sent.

An internet-based economy therefore requires a new kind of security technology in order to


protect information people send online. Actually, the field of information protection –
known as “cryptography” or “hidden writing” – is not new. It dates back several thousand
years.

Cryptography is the process of transferring information securely, in a way that no unwanted


third party will be able to understand the message. It has been used for thousands of years.
Number theory and Cryptography are inextricably linked, as we shall see in the following
section.

RSA algorithm to encrypt and decrypt


RSA Algorithm is used to encrypt and decrypt data in modern computer systems and other
electronic devices. RSA algorithm is an asymmetric cryptographic algorithm as it creates 2
different keys for the purpose of encryption and decryption. It is public key cryptography as
one of the keys involved is made public. RSA stands for Ron Rivest, Adi Shamir and
Leonard Adleman who first publicly described it in 1978. RSA makes use of prime
numbers (arbitrary large numbers) to function. The public key is made available publicly
(means to everyone) and only the person having the private key with them can decrypt the
original message.

Working procedure of RSA Public key


RSA involves use of public key and private key for its operation. The keys are generated
using following steps:

1. Two prime numbers are selected as 𝑝 and 𝑞.

2.𝑛 = 𝑝𝑞, which is the modulus of both the keys

3. Calculate the totient = (𝑝 − 1)(𝑞 − 1)

4. Choose 𝑒 such that 𝑒 > 1 and coprime to totient which means gcd (𝑒, 𝑡𝑜𝑡𝑖𝑒𝑛𝑡) must be
equal to 1, 𝑒 is the public key

second Semester 16 Number theory (22MA21C)


Department of Mathematics

5. Choose 𝑑 such that it satisfies the equation 𝑑𝑒 = 1 + 𝑘(𝑡𝑜𝑡𝑖𝑒𝑛𝑡), 𝑑 is the private key not
known to everyone

6. Cipher text is calculated using the equation 𝑐 = 𝑚𝑒 (𝑚𝑜𝑑 𝑛), where 𝑚 is the message.

7. With the help of 𝑐 and 𝑑 we decrypt message using the equation 𝑚 = 𝑐 𝑑 (𝑚𝑜𝑑 𝑛), where
𝑑 is the private key.

A very simple example of RSA encryption


1. Select primes 𝑝 = 11, 𝑞 = 3.

2. 𝑛 = 𝑝𝑞 = 11 × 3 = 33

𝜙 = (𝑝 − 1)(𝑞 − 1) = (11 − 1)(3 − 1) = 20

3. Choose 𝑒 = 3.

𝑔𝑐𝑑(𝑒, 𝑝 − 1) = 𝑔𝑐𝑑(3, 10) = 1

𝑔𝑐𝑑(𝑒, 𝑞 − 1) = 𝑔𝑐𝑑(3, 2) = 1

∴ 𝑔𝑐𝑑(𝑒, 𝜙) = 𝑔𝑐𝑑(𝑒, (𝑝 − 1)(𝑞 − 1)) = 𝑔𝑐𝑑(3, 20) = 1

4. Compute 𝑑 such that 𝑒𝑑 ≡ 1 (𝑚𝑜𝑑 𝜙)

Compute 𝑑 = (1/𝑒) (𝑚𝑜𝑑 𝜙) = (1/3) (𝑚𝑜𝑑 20)

Find a value for 𝑑 such that 𝜙 divides (𝑒𝑑 − 1)

Find 𝑑 such that 20 divides 3𝑑 − 1.

Simple testing (𝑑 = 1, 2, ⋯ ) gives 𝑑 = 7

𝑒𝑑 − 1 = 3 × 7 − 1 = 20, which is divisible by 𝜙.

5. Public key = (𝑛, 𝑒) = (33, 3)

Private key = (𝑛, 𝑑) = (33, 7)

This is actually the smallest possible value for the modulus 𝑛 for which the RSA algorithm
works.

Now say we want to encrypt the message 𝑚 = 7

𝑐 = 𝑚𝑒 (𝑚𝑜𝑑 𝑛) = 73 𝑚𝑜𝑑 33 = 343 𝑚𝑜𝑑 33 = 13

Hence the cipher text c = 13.

second Semester 17 Number theory (22MA21C)


Department of Mathematics

To check decryption, we compute

𝑚 = 𝑐 𝑑 (𝑚𝑜𝑑 𝑛) = 137 𝑚𝑜𝑑 33 = 7

If we wanted to use this system to keep secrets, we could let 𝐴 = 2, 𝐵 = 3, ⋯ , 𝑍 = 27.


Thus the plaintext message "HELLO" would be represented by the set of integers
𝑚1 , 𝑚2 , ⋯
(9,6,13,13,16)
For the encryption of the letter 𝐻 = 9, we use
𝑐1 = 𝑚𝑒 (𝑚𝑜𝑑 𝑛) = 93 𝑚𝑜𝑑 33 = 729 𝑚𝑜𝑑 33 = 3

For the encryption of the letter 𝐸 = 6, we use


𝑐2 = 𝑚𝑒 (𝑚𝑜𝑑 𝑛) = 63 𝑚𝑜𝑑 33 = 216 𝑚𝑜𝑑 33 = 18

For the encryption of the letter 𝐿 = 13, we use


𝑐3 = 𝑚𝑒 (𝑚𝑜𝑑 𝑛) = 133 𝑚𝑜𝑑 33 = 2197 𝑚𝑜𝑑 33 = 19

For the encryption of the letter 𝑂 = 16, we use


𝑐4 = 𝑚𝑒 (𝑚𝑜𝑑 𝑛) = 163 𝑚𝑜𝑑 33 = 4096 𝑚𝑜𝑑 33 = 4

We obtain cipher text integers c1 , c2 , ⋯


(3,18,19,19,4)
Therefore the cipher text is BQRRC.

Exercises
1. Given the public key (𝑒, 𝑛) = (7,55), encrypt plain text PLAN, where the alphabets
𝐴, 𝐵, 𝐶, … 𝑋, 𝑌, 𝑍 are assigned the numbers 2,3, ⋯ ,26,27. Give the cipher text. Find the
private key 𝑑.
2. Given the public key (𝑒, 𝑛) = (7,85), encrypt plain text HI, where the alphabets
𝐴, 𝐵, 𝐶, … 𝑋, 𝑌, 𝑍 are assigned the numbers 2,3, ⋯ ,26,27. Give the cipher text. Find the
private key 𝑑.

Answers:
1. Cipher text is GFQD (8,7,18,5) and private key 𝑑 = 23.
2. Cipher text is RD (19, 5) and private key 𝑑 = 55.

second Semester 18 Number theory (22MA21C)

You might also like