Professional Documents
Culture Documents
Elementary Number
Theory
1
Introduction to Number Theory
Number theory is about integers ( )
and their properties.
2
Division
Definition : If a and b are integers with a 0, we
say that a divides b if there is an integer c such
that b = ac.
4
Lets think!
6
Divisibility of Algebraic Terms
7
Divisibility Theorems
For integers a, b, and c, the following theorems hold:
Thm1 : If a | b and a | c, then a | (b + c)
Example: 3 | 6 and 3 | 9, so 3 | 15.
8
Proving Thm3
9
Exercise :
10
Primes
A positive integer p greater than 1 is called prime
if the only positive factors of p are 1 and p.
11
Primes
Examples:
15 = 3·5
48 = 2·2·2·2·3 = 24·3
17 = 17
100 = 2·2·5·5 = 22·52
512 = 2·2·2·2·2·2·2·2·2 = 29
515 = 5·103
28 = 2·2·7
12
The Division Algorithm
Let a, b be integers such that b>0 .
Then there are unique integers q and r, such that
a = bq + r
where 0 r < b
17 = 53 + 2.
• 17 is the dividend,
• 5 is the divisor,
• 3 is called the quotient, and
• 2 is called the remainder.
14
The Division Algorithm
Another example:
What happens when we divide -11 by 3 ?
Note that the remainder cannot be negative.
-11 = 3(-4) + 1.
15
So, what happens when b is a
negative integer?
16
Some examples when b<0
Let b = -7
We choose a = 1, -2, 61 and -59. We get
17
Greatest Common Divisors
Let a and b be integers, not both zero.
The largest integer d such that d | a and 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) or simply (a,b).
whenever 1 i < j n.
22
Relatively Prime Integers
Definition:
Two integers a and b (not both zeros) are relatively
prime or mutually prime or coprime if gcd(a, b) = 1.
Examples:
Are 15 and 28 relatively prime?
Yes, gcd(15, 28) = 1.
Are 55 and 28 relatively prime?
Yes, gcd(55, 28) = 1.
Are 35 and 28 relatively prime?
No, gcd(35, 28) = 7.
23
Coprime & pairwise coprime
A set of integers can also be called coprime if its
elements share no common positive factor
except 1.
A stronger condition on a set of integers
is pairwise coprime or relatively prime which
means that a and b are coprime for every
pair (a, b) of different integers in the set.
The set {2, 3, 4} is coprime, but it is not pairwise
coprime since 2 and 4 are not relatively prime.
24
Pairwise Relatively Prime Integers
Definition:
The integers a1, a2, …, an are pairwise relatively
prime if gcd(ai, aj) = 1 whenever 1 i < j n.
Examples:
Are 15, 17, and 27 pairwise relatively prime?
No, because gcd(15, 27) = 3.
Are 15, 17, and 28 pairwise relatively prime?
Yes, because gcd(15, 17) = 1, gcd(15, 28) = 1 and
gcd(17, 28) = 1.
25
Euler’s totient function
The number of integers coprime to a positive
integer n, (between 1 and n), is given by
Euler’s totient function (or Euler's phi
function) φ(n).
φ(n) = number of integers k in the range 1
≤ k ≤ n for which the gcd(n, k) = 1
Euler's product formula
where the product is over the distinct
primes dividing n. Eg, find φ(36)
= 12. 26
Find :
1) φ(1)
2) φ(2)
3) φ(3)
4) φ(4)
5) φ(5)
6) φ(6)
27
Some applications of Euler’s
totient function
• Fermat’s little theorem
• Euler’s generalization of
Fermat’s little theorem
• Primality testing
• Party tricks
• RSA public key encryption
28
Least Common Multiples
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 (a|lcm & b|lcm).
We denote the least common multiple of a and b by
lcm(a, b) or simply [a,b].
Examples:
lcm(3, 7) = 21
lcm(4, 6) = 12
lcm(5, 10) = 10
29
Least Common Multiples
Using prime factorizations and WLOG let
Example:
a = 60 = 22 31 51
b = 54 = 21 33 50
lcm(a, b) = 22 33 51 = 4275 = 540
30
GCD and LCM
a = 60 = 22 31 51
b = 54 = 21 33 50
gcd(a, b) = 21 31 50 =6
lcm(a, b) = 22 33 51 = 540
31
Exercise : Prove the theorem.
32
Modular Arithmetic
Motivation
Let us use a clock as an example. Look
carefully at this clock.
Notice, I have replaced the 12 at the top
of the clock with a zero.
Examples:
9 mod 4 = 1
9 mod 3 = 0
9 mod 10 = 9
-13 mod 4 = 3 Reason: -13 = ( -4 )4 + (3)
34
Properties of Modular
Arithmetic
•if m divides a – b.
•Notation to indicate that a is congruent to b
modulo m is a b (mod m) .
•In other words:
a b (mod m) if and only if a mod m = b mod m.
•Or, if the remainder when a is divided by m is
same when b is divided by m.
36
Congruences
Examples:
Is it true that 46 68 (mod 11) ?
Yes, because 11 | (46 – 68=-22).
37
Properties of Congruence relation:
Theorem 1: Let m be a positive integer.
The integers a and b are congruent modulo
m if and only if there is an integer k such
that a = b + km.
Theorem 2: Let m be a positive integer. If
a b (mod m) and c d (mod m), then
i) a + c b + d (mod m) and
ii) ac bd (mod m).
38
Congruences
Proof for Thm 2:
We know that a b (mod m) and c d (mod m)
implies that there are integers s and t with
b = a + sm and d = c + tm.
Therefore,
b + d = (a + sm) + (c + tm) = (a + c) + m(s + t) and
bd = (a + sm)(c + tm) = ac + m(at + cs + stm).
Hence, a + c b + d (mod m) and ac bd (mod m).
39
Applications…
40
The Euclidean Algorithm
41
Euclid’s “Element”
• The Elements is a mathematical treatise consisting of 13 books
attributed to the Greek mathematician Euclid, 300 BC.
• These books cover plane and solid Euclidean geometry, elementary number
theory, and incommensurable lines.
• Euclid put together the Elements, collecting many of the work from
earlier Greek mathematicians in a single, logically coherent framework.
• He collected Eudoxus' theorems, perfecting many of Theaetetus', and
also proving things which were only somewhat loosely proved by his
predecessors".
• The source for most of books I and II : Pythagoras (c. 570–495 BC)
• for book III : Hippocrates of Chios (c. 470–410 BC),
• for book V : Eudoxus of Cnidus (c. 408–355 BC),
• For books IV, VI, XI, and XII probably came from other Pythagorean or
Athenian mathematicians
The Euclidean Algorithm
43
In the next step, we divide 91 by 14:
91 = 146 + 7
This means that gcd(14, 91) = gcd(14, 7).
And, 7 | 14, and thus gcd(14, 7) = 7.
44
Proof:
Lemma 3.3.1 Suppose a and b are integers, not both zero.
a) (a,b) = (b,a),
b) if a > 0 and a|b then (a,b) = a,
c) if a ≡ c(mod b), then (a,b) = (c,b).
Proof.
Part (a) is clear, since a common divisor of a and b is a common divisor of b and a.
For part (b), note that if a|b, then a is a common divisor of a and b. Clearly a is the
largest divisor of a, so we are done.
Finally, for part (c):
If a ≡ c(mod b), then b|(a−c), so there is a y such that a − c = by, i.e., c = a − by.
If d divides both a and b, then it also divides a − by. Therefore, any common
divisor of a and b is also a common divisor of c and b.
Similarly, if d divides both c and b, then it also divides c + by = a, so any common
divisor of c and b is a common divisor of a and b.
This shows that the common divisors of a and b are exactly the common divisors
of c and b.
So, in particular, they have the same greatest common divisor. 45
To compute (a,b) : Divide the larger number (say a) by the
smaller number,
Now b = r1q2 + r2, r2 < r1, and (b, r1) = (r1, r2);
then r1= r2q3 + r3, r3< r2, and (r1, r2) = (r2, r3), and so on.
(a, b) = (b, r1) = (r1, r2) = (r2, r3) = … = (rk-1, rk) = (rk-1, 0) = rk-1;
47
Some more examples
1) 252 and 105
2) 1071 and 462
3) 57 and 114
Answers :
21, 21, 57.
With a little extra bookkeeping, we can
use the Euclidean Algorithm to show
that gcd(a,b) is actually a linear
combination of a and b.
49
For example, 198 = 168(1) + 30
168 = 30(5) + 18
30 = 18(1) + 12
Thus, (198,168) = 6 18 = 12(1) + 6
12 = 6(2) + 0
50
Notice that the numbers in the left column are
precisely all the remainders computed by the
Euclidean Algorithm.
51
The Extended Euclidean Algorithm
52