4.3 The Euclidean algorithm
In this section we shall develop an efficient method to calculate
for which does not depend on
finding all the factors of and themselves. Moreover, this
method will give us an explicit way of determining such
that .
We begin by noting the effect of ‘‘division with remainder’’ on
highest common factors.
Proposition 4.3.1
If
with and , then .
Example 4.3.2
, and
Proof. Let be a factor of . We begin by showing that
divides if and only if divides . Indeed, by
Lemma 4.2.13, if divides , then divides
, and conversely, if divides , then divides
. Thus is a common factor of and
if and only if is a common factor of and , and
therefore .
Now suppose that (otherwise we interchange them, as
Remark 4.2.5(iii) allows us to). Then we can use
‘‘division with remainder’’ to replace the pair of numbers and
with the pair and , without changing the highest common factor.
Since the new pair is ‘‘smaller’’ than the old one, we have simplified
the problem. This suggests that we can use this technique repeatedly,
making each old divisor the new number to be divided, and each old
remainder the new divisor, continuing until the divison leaves no
remainder:
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
This process is called the Euclidean algorithm; it must
terminate since the remainders form a strictly decreasing
sequence of natural numbers: . By repeated use
of Proposition 4.3.1, we see that the last divisor is
the highest common factor, because
|
|
|
We may then reverse the steps to
obtain the highest common factor as an integral linear combination
of and .
Some examples will clarify how this works in practice.
Example 4.3.3
Find , and express it as an integral linear
combination of and .
Solution.
|
|
|
Example 4.3.4
Find , and express it as an integral linear
combination of and .
Solution.
|
|
|