Académique Documents
Professionnel Documents
Culture Documents
Number Theory
c
ntroduction to Number Theory
c
ivisibility Theorems
For integers a, b, and c it is true that
if a | b and a | c, then a | (b + c)
º
V | 6 and V | 9, so V | 15.
if a | b and b | c, then a | c
º
4 | 8 and 8 | 24, so 4 | 24.
c
[rimes
A positive integer p greater than 1 is called prime
if the only positive factors of p are 1 and p.
c
[rimes
Examples:
15 = V5
48 = 2 2 2 2 V = 24 V
17 = 17
1|| = 2 2 5 5 = 22 52
512 = 2 2 2 2 2 2 2 2 2 = 29
515 = 5 1|V
28 = 227
c
[rimes
c
The ivision Algorithm
Let be an integer and ë a positive integer.
Then there are unique integers and , with
ë
ë,, such that ë
ë..
c
The ivision Algorithm
º
5åV + 2.
17 = 5å
17 is the dividend,
5 is the divisor,
V is called the quotient, and
2 is called the remainder.
c
The ivision Algorithm
r
What happens when we divide -11 by V ?
Note that the remainder cannot be negative.
Vå(-4) + 1.
-11 = Vå
c
Xreatest Common ivisors
Let a and b be integers, not both zero.
The largest integer d such that d | a and d | b is
called the
ë
of a and b.
The greatest common divisor of a and b is denoted
by gcd(a, b).
º
What is gcd(48, 72) ?
The positive common divisors of 48 and 72 are
1, 2, V, 4, 6, 8, 12, 16, and 24, so gcd(48, 72) = 24.
º
What is gcd(19, 72) ?
The only positive common divisor of 19 and 72 is
1, so gcd(19, 72) = 1.
c
Xreatest Common ivisors
o
a = p1a1 p2a2 « pnan , b = p1b1 p2b2 « pnbn ,
where p1 < p2 < « < pn and ai, bi i for 1 i n
º
a = 6| = 22 V1 51
b = 54 = 21 VV 5|
gcd(a, b) = 21 V1 5| = 6
c
Velatively [rime ntegers
Two integers a and b are
if
gcd(a, b) = 1.
º
Are 15 and 28 relatively prime?
Yes, gcd(15, 28) = 1.
Are 55 and 28 relatively prime?
Yes, gcd(55, 28) = 1.
Are V5 and 28 relatively prime?
No, gcd(V5, 28) = 7.
c
Velatively [rime ntegers
The integers a1, a2, «, an are
if gcd(ai, aj) = 1 whenever 1 i < j n.
º
Are 15, 17, and 27 pairwise relatively prime?
No, because gcd(15, 27) = V.
Are 15, 17, and 28 pairwise relatively prime?
Yes, because gcd(15, 17) = 1, gcd(15, 28) = 1 and
gcd(17, 28) = 1.
c
Least Common Multiples
The
of the positive
integers a and b is the smallest positive integer
that is divisible by both a and b.
We denote the least common multiple of a and b
by lcm(a, b).
º
lcm(V, 7) = 21
lcm(4, 6) = 12
lcm(5, 1|) = 1|
c
Least Common Multiples
o
a = p1a1 p2a2 « pnan , b = p1b1 p2b2 « pnbn ,
where p1 < p2 < « < pn and ai, bi i for 1 i n
º
a = 6| = 22 V1 51
b = 54 = 21 VV 5|
4å27
lcm(a, b) = 22 VV 51 = 4å 27åå5 = 54|
c
XC and LCM
a = 6| = 22 V1 51
b = 54 = 21 VV 5|
gcd(a, b) = 21 V1 5| =6
lcm(a, b) = 22 VV 51 = 54|
!
åå ë å
!
c
Modular Arithmetic
Let a be an integer and m be a positive integer.
We denote by
ë the remainder when a is
divided by m.
º
9 mod 4 = 1
9 mod V = |
9 mod 1| = 9
-1V mod 4 = V
c
Congruences
Let a and b be integers and m be a positive integer.
We say that
ë
if
m divides a ² b.
n other words:
a 0 b (mod m) if and only if
ë
ë.
ë
ë.
c
Congruences
º
s it true that 46 0 68 (mod 11) ?
Yes, because 11 | (46 ² 68).
s it true that 46 0 68 (mod 22)?
Yes, because 22 | (46 ² 68).
For which integers z is it true that z 0 12 (mod 1|)?
z{«,
t is true for any z {«,--28, -18, -8, 2, 12, 22, V2, «}
!
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.
c
Congruences
!
Let m be a positive integer.
f a 0 b (mod m) and c 0 d (mod m), then
a + c 0 b + d (mod m) and ac 0 bd (mod m).
[
We know that a 0 b (mod m) and c 0 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 0 b + d (mod m) and ac 0 bd (mod m).
c
The Euclidean Algorithm
The º
ë r
finds the
ë
of two integers a and b.
For example, if we want to find gcd(287, 91), we
ëë 287 by 91:
91åV + 14
287 = 91å
We know that for integers a, b and c,
if a | b and a | c, then a | (b + c).
Therefore, any divisor of 287 and 91 must also be
a divisor of 287 - 9191ååV = 14.
Consequently, gcd(287, 91) = gcd(14, 91).
c
The Euclidean Algorithm
n the next step, we divide 91 by 14:
14å6 + 7
91 = 14å
This means that gcd(14, 91) = gcd(14, 7).
So we divide 14 by 7:
7å 2 + |
14 = 7å
We find that 7 | 14, and thus gcd(14, 7) = 7.
!
ë!"# "$
c
The Euclidean Algorithm
n ë
ë
ë
ë,, the algorithm can be implemented
as follows:
ë gcd(a, b: positive integers)
x := a
y := b
y |
r := x
ë y
x := y
y := r
ë {x is gcd(a, b)}
c
Vepresentations of ntegers
Let b be a positive integer greater than 1.
Then if n is a positive integer, it can be expressed
in the form:
º
8å1|2 + 5å
859 = 8å 5å1|1 + 9å
9å1||
c
Vepresentations of ntegers
º
1å24 + 1å
(1|11|)2 = 1å 1å22 + 1å
1å21 = (22)1|
º
% ë
(we use letters A to F to indicate numbers 1| to 15)
Vå16V + 1|å
(VA|F)16 = Vå 1|å162 + 15å
15å16| = (1486V)1|
c
Vepresentations of ntegers
How can we construct the base b expansion of an
integer n?
First, divide n by b to obtain a quotient q| and
remainder a|, that is,
n = bq| + a|, where | a| < b.
The remainder a| is the rightmost digit in the base
b expansion of n.
Next, divide q| by b to obtain:
q| = bq1 + a1, where | a1 < b.
a1 is the second digit from the right in the base b
expansion of n. Continue this process until you
obtain a quotient equal to zero.
c
Vepresentations of ntegers
º
What is the base 8 expansion of (12V45)1| ?
c
Addition of ntegers
Let a = (an-1an-2«a1a|)2, b = (bn-1bn-2«b1b|)2.
How can we add these two binary numbers?
First, add their rightmost bits:
a| + b| = c|å2 + s|,
where s| is the
in the binary
expansion of a + b, and c| is the
..
Then, add the next pair of bits and the carry:
a1 + b1 + c| = c1å2 + s1,
where s1 is the in the binary expansion of
a + b, and c1 is the carry.
c
Addition of ntegers
c
Addition of ntegers
º
Add a = (111|)2 and b = (1|11)2.
Therefore, s = a + b = (11||1)2.
c
Addition of ntegers
How do we (humans) add two integers?
1 11 carry
Example: 758V
+ 49V2
1 25 1 5
1 1 carry
Binary expansions: (1|11)2
+ (1|1|)2
(1|1 |1 )2
c
Addition of ntegers
Let a = (an-1an-2«a1a|)2, b = (bn-1bn-2«b1b|)2.
How can we
add
add these two binary
numbers?
First, add their rightmost bits:
a| + b| = c|å2 + s|,
where s| is the
in the binary
expansion of a + b, and c| is the
..
Then, add the next pair of bits and the carry:
a1 + b1 + c| = c1å2 + s1,
where s1 is the in the binary expansion of
a + b, and c1 is the carry.
c
Addition of ntegers
c
Addition of ntegers
º
Add a = (111|)2 and b = (1|11)2.
Therefore, s = a + b = (11||1)2.
c
Addition of ntegers
ëadd(a, b: positive integers)
ëadd(a,
c := |
for j := | to n-n-1
begin
d := (aj + bj + c)/2
sj := aj + bj + c ² 2d
c := d
end
sn := c
{the binary expansion of the sum is (snsn-1«s1s|)2}
c