Escolar Documentos
Profissional Documentos
Cultura Documentos
Table of contents
0. Introductory comments
1. Division algorithm
2. Prime factorisation
3. Modular arithmetic
0. Introductory comments
{· · · , −2, −1, 0, 1, 2, · · · }.
Moreover, N denotes positive integers
{1, 2, · · · }.
1. Division algorithm
a | b.
Examples 1.1.
(i) 4 | 12
(ii) 6 6 |15
1
Theorem 1.1. Let a, b ∈ Z and suppose
b 6= 0. Then there exists unique integers q
and r such that
a = bq + r
and
0 ≤ r < b.
Proof of existence
2
Proof of uniqueness
3
Exercise 1.1.
4
Definition 1.2. Let a and b be non-zero
integer. The greatest common divisor of a
and b, denoted by gcd(a, b), is the largest
integer d dividing both a and b.
(i) d | a;
(ii) d | b;
Example 1.1
(i) gcd(21, 6) =
(ii) gcd(14, 2) =
(iv) gcd(a, 0) =
5
Exercise 1.1. Let a = bq +r be as in the di-
vision algorithm. Then gcd(a, b) = gcd(b, r).
Input a ≥ b ≥ 0, a 6= 0.
return r.
Example 1.2
gcd(2234, 1020) =
6
2. Primes
Example 2.1
Exercise 2.1.
a | c, and b | c =⇒ ab | c.
7
Definition 2.2.
Proof.
8
Theorem 2.2 (Fundamental Theorem of
Arithmetic) Every integer a can be written
as
a = p1 p2 · · · pk
where p1 ≤ p2 ≤ · · · ≤ pk are prime numbers.
Moreover, this presentation is unique.
Proof of Existence
9
Proof of Uniqueness
10
Comments 2.2. Unique factorisation fails
in slightly more general setting; e.g. in
√ √
Z[ −5] = {a + b −5 | a, b ∈ Z}.
For instance,
√ √
2.3 = (1 + −5)(1 − −5) = 6.
Comments 2.3
11
3. Modular Arithmetic
n | a − b.
In this case, we write a ≡ b mod n.
Examples 3.1
(i) 21 ≡ 3 mod 6.
12
Comments 3.1
(i) a ≡ b mod n if and only if a and b have
the same remainder under division by n.
(ii) a ≡ 0 mod n if and only if n | a.
Examples 3.2
(i) If n = 2 then [1] is the set of all odd num-
bers and [0] is the set of all even numbers.
(ii) If n = 5, then
[2] = {· · · , −8, −3, 2, 7, 12, · · · }
[a].[b] = [a.b].
Examples 3.3
14
Theorem 3.1 Addition and multiplication
in Zn is well-defined; i.e. if [a] = [b] and
[c] = [d] then
Proof.
15
Question 3.1 What about subtracting in
Zn?
Examples 3.3
[3]−1 = [4].
16
Theorem 3.2
Proof.
17
Theorem 3.3 Let n > 1. Then [a] ∈ Zn is
invertible if and only if gcd(a, n) = 1.
Proof.
18
Corollary 3.1 Let p be a prime number and
suppose a 6= 0. Then [a] is invertible in Zp.
Exercise 3.2.
x≡1 mod 3
x≡2 mod 5
x≡3 mod 7
is solvable. Indeed, x = 52 is a solution. Is
this the only solution?
20
Theorem 3.4 (Chinese Remainder The-
orem). Let m1, · · · , mk ∈ N be pairwise co-
prime positive integers. Then every system
of equations
Proof
21
Proof continued.
22
Notation 3.2. We let Z× n denote the set of
units (=invertible) elements in Zn.
Example 3.6.
23
Theorem 3.5. Let a ∈ Z× m
n . Then a = 1 if
and only if m is a multiple of o(a).
Proof.
24
Exercise 3.3. Show that if a ∈ Z×
n then
o(a) | |Z×
n |.
Z× 2
n = {1, a, a , · · · , a
n−1 }.
(i) 2 ∈ Z5
(ii) 4 ∈ Z11
(ii) 3 ∈ Z8
25
Definition 3.6. The function ϕ : N → N
defined by
n 7→ |Z×
n|
is called the Euler ϕ function.
Example 3.8.
(i) ϕ(6) =
(ii) ϕ(p) =
(ii) ϕ(2n) =
Qk a
Exercise 3.7. Compute ϕ( i=1 pi i ).
26
Theorem 3.7 (Euler’s Theorem). Let
a, n ∈ Z with n ≥ 1 and gcd(a, n) = 1. Then
aφ(n) ≡ 1 mod n.
Proof.
27
Corollary 3.2 (Fermant’s Little Theorem).
Let p be a prime and a not divisible by p.
Then ap ≡ a mod p.
Proof.
28