Notation Given integers and , not both zero, we write or for the greatest common divisor of and .
Example 1.1.1
Very inefficiently—the positive divisors of 12 are 1, 2, 3, 4, 6 and 12, so = 4
Is there a more efficient way to do this?
Example 1.1.2
Suppose we want to find . We have
So the gcd is 2.
We may assume that since
- Put and
- Use the division algorithm to find such that and
- If then
- If , then set and , and repeat the process
Proof
The are decreasing, so the algorithm must terminate. If , then the common divisors of and are the same as the common divisors of and , so . If the algorithm terminates are steps, then
Example 1.1.3
Euclid’s algorithm can be run backwards to express the gcd as a linear combination of the two numbers. This is called the extended Euclidean algorithm
We haveThis gives a practical way to establish the fundamental result below
Multi
Lemma 1.1.4 (Bezout’s Lemma)
Let and be integers, not both zero. Then there exist such that
Corollary 1.15
Let and be integers, not both zero, and let . Then divides and if and only if
Proof
If divides , then it divides and . Conversely, suppose divides and . For some , we have
which is divisible by .