Section 4.2 – Divisibility & the Euclidean Algorithm¶
definition: For integers $a$ and $b$, we say $a$ divides $b$, if $\exists k in \mathbb Z$ such that,
this is denoted $a \mid b$. In this case we can say $a$ is a divisor or factor of $b$. We can also say $b$ is divisible by $a$.
If $a$ is not a divisor of $b$, then we write,
Alternatively,
Example
Facts¶
For any integer $n$,
- $n \mid 0 $ since $0 = n(0)$
- $0 \nmid n$ since $\not\exists k$ such that $0 = nk$
Proposition¶
Let $a,b,c \in \mathbb Z$. If $a \mid b$ and $b \mid c$ then $a \mid c$.
Proof¶
Since $a \mid b$, then $\exists k \in \mathbb Z$ such that $b = ak$. Likewise, since $b \mid c$, $\exists m \in \mathbb Z$ such that $c = bm$. So,
and $km \in \mathbb Z$ since the integers are closed under multiplication. Therefore, since $c = a(km)$, $a \mid c$.
Proposition 1¶
Let $a,b \in \mathbb Z$. If $a \mid b$ and $a \mid c$ the we can say,
for any $x,y \in \mathbb Z$.
Proof¶
Since $a \mid b$, $\exists k \in \mathbb Z$ such that $b = ak$ and since $a \mid c$, $\exists m \in \mathbb Z$ such that $c = am$. Let $x,y \in \mathbb Z$,
since the integers are close under addition and multiplication, $kx + my \in \mathbb Z$. Therefore $a \mid bx + cy$.
Common Divisors¶
definition: Let $a$ and $b$ be integers, such that they are not both zero. Then $g$ is the greatest common divisor of $a$ and $b$ if,
- $g \mid a$ and $g \mid b$ ("common divisor")
- if $c$ is also a common divisor, $g \ge c$ ("greatest")
and we write $g = \gcd(a,b)$
Example
Find $\gcd(6,15)$.
Solution
List the divisors,
- $6: 1,2,3,6$
- $15: 1,3,5,15$
So $\gcd(6,15) = 3$
Facts¶
For any integer $a$,
- $\gcd(a,0) = |a|$
- $\gcd(a,1) = 1$
- If $a \mid b$, then $\gcd(a,b) = |a|$
Proposition 2¶
If $a,b \in \mathbb Z$, not both zero, and $a = bq + r$ (for some $q,r \in \mathbb Z$) then $\gcd(a,b) = \gcd(b,r)$.
Proof¶
We'll show that $\gcd(a,b) \le \gcd(b,r)$ and $\gcd(b,r) \le \gcd(b,r)$
We know, $\gcd(a,b) \mid a$ and $\gcd(a,b) | b$ so we can say,
and we'll let $x = 1$ and $y = -q$,
note that $r = a - bq$, so,
So right now we know $\gcd(a,b) \le \gcd(b,r)$
We also know $\gcd(b,r) \mid b$ and $\gcd(b,r) \mid r$ so,
since $qb + r = a$,
and $\gcd(a,b) = \gcd(b,r)$.
The Euclidean Algorithm for find GCD¶
Let $a,b \in \mathbb N$, with $b < A$. To find the $\gcd(a,b)$, write,
and $\gcd(a,b) = r_{i-1}$.
Example
Find $\gcd(88,72)$.
Solution
So $\gcd(88,72) = 8$.
Example
Find $\gcd(78,35)$.
Solution
So $\gcd(78,35) = 1$, they are relatively prime.
Relative Primes¶
definition: If $a,b \in \mathbb Z$ and $\gcd(a,b) = 1$ then we say $a$ and $b$ are __relatively prime_ since they have no common factors.
Fact¶
For $a,b \in \mathbb Z$, not both zero, $\exists x,y \in \mathbb Z$ such that,
To find $x$ and $y$ we must use the Euclidean Algorithm in reverse.
Example
Find $x,y$ such that $1 = 78x + 35y$.
Solution
So $1 = \gcd(78,35) = 78x + 35y$ where $x = -13$ and $y = 29$.
Corollary¶
Let $a,b,x \in \mathbb Z$ such that $a \mid bx$. If $a$ and $b$ are relatively prime, then,
Proof¶
Let $a,b,x \in \mathbb Z$ such that $a \mid bx$, and suppose, $a$ and $b$ are coprime, then,
By the last fact $\exists y,z \in \mathbb Z$ such that $\gcd(a,b) = ay + bz$. Multiplying by $x$ yields,
clearly, $a \mid axz$, since $a \mid bx$, $a \mid bxy$.
Corollary¶
Let $a,b,c \in \mathbb Z$ such that $c \mid a$ and $c \mid b$.
LCM¶
definition: If $a,b \neq 0$ are integers, we say $\ell$ is their least common multiple if,
- $a \mid \ell$ and $b \mid \ell$
- if $a \mid m$ and $b \mid m$ then $\ell \le m$
and we write $\ell = \text{lcm}(a,b$).
Examples
- $\text{lcm}(3,4) = 12$
- $\text{lcm}(4,6) = 12$
- $\text{lcm}(1,a) = a$
Fact¶