Chapter4 Number
Chapter4 Number
DISCRETE MATHEMATICS
Chapter 4: Number Theory and
Cryptography
❖ Key ideas in number theory include divisibility and the primality of integers.
❖ Representations of integers, including binary and hexadecimal
representations, are part of number theory.
❖ Number theory has long been studied because of the beauty of its ideas, its
accessibility, and its wealth of open questions.
❖ Division
❖ Division Algorithm
❖ Modular Arithmetic
Example: The congruence 14≡ 8 (mod 6) holds. But dividing both sides by 2
does not produce a valid congruence since 14/2 = 7 and 8/2 = 4, but
7≢4 (mod 6).
Copyright © Nahid Sultana 2020-2021. 10/4/2023
Computing the mod m Function of
Products and Sums
13
continued →
Copyright © Nahid Sultana 2020-2021. 10/4/2023
Arithmetic Modulo m
16
Example:
✓ The integer 7 is prime because its only positive factors are 1 and 7.
✓ but 9 is composite because it is divisible by 3.
Examples:
❖ 100 = 2 ∙ 2 ∙ 5 ∙ 5 = 22 ∙ 52
❖ 641 = 641
❖ 999 = 3 ∙ 3 ∙ 3 ∙ 37 = 33 ∙ 37
❖ 1024 = 2 ∙ 2 ∙ 2 ∙ 2 ∙ 2 ∙ 2 ∙ 2 ∙ 2 ∙ 2 ∙ 2 = 210
Definition: Let a and b be integers, not both zero. The largest integer
d such that d | a and also d | b is called the greatest common
divisor of a and b.
The greatest common divisor of a and b is denoted by gcd(a,b).
➢ Finding the gcd of two positive integers using their prime factorizations is not
efficient because there is no efficient algorithm for finding the prime
factorization of a positive integer.
Copyright © Nahid Sultana 2020-2021. 10/4/2023
Least Common Multiple
23
Definition: The least common multiple of the positive integers a and b is the
smallest positive integer that is divisible by both a and b.
It is denoted by lcm(a,b).
➢ The least common multiple can also be computed from the prime
factorizations.