The definition of the greatest common divisor of two integers is intuitive. To make it unique, we require it to be positive, that is, we require the greatest common divisor to be a natural number.
Let \(a\) and \(b\) be integers. The greatest natural number \(g\) that divides both \(a\) and \(b\) is called the greatest common divisor of \(a\) and \(b\) and is denoted by \(\gcd(a,b)\text{.}\)
Example4.11.Greatest common divisor of \(12\) and \(42\).
We find the greatest common divisor of \(12\) and \(42\text{.}\) As all divisors of 12 are less than or equal to 12, we only have to check numbers less than 12.
Checkpoint4.13.Special cases of greatest common divisors.
For each of the following pairs of numbers, find the greatest common divisor. Although the numbers are large finding their greatest common divisor is not too hard. Taking a closer look at both numbers reveals special relationships.
Our next goal is to find an efficient method for finding greatest common divisors in general. Recall that remainder of division of \(a\) and \(b\) is \(a - (b\cdot q)\) where \(q := a \fdiv b\text{.}\)Theorem 4.14 tells us that we can use the remainder to help us find the greatest common divisor.
As \(g\) divides \(a\) there exists an integer \(s\) such that \(a=g\cdot s\) and as \(g\) divides \(b\) there exists an integer \(t\) such that \(b=g\cdot t\text{.}\) We now have
As \(g\) divides \(a-(b\cdot q)\) there exists an integer \(s\) such that \(a-(b\cdot q)=g\cdot s\) and as \(g\) divides \(b\text{,}\) there exists an integer \(s\) such that \(b=g\cdot t\text{.}\) We now have
By Item 1 all natural numbers \(g\) that divide \(a\) and \(b\) also divide \(a-(b\cdot q)\text{.}\) By Item 2 all natural numbers \(g\) that divide \(a-(b\cdot q)\) and \(b\) also divide \(a\text{.}\) Thus the common divisors of \(a\) and \(b\) and the common divisors of \(a-(b\cdot q)\) are the same. So, in particular, the greatest common divisor of \(a\) and \(b\) is equal to the greatest common divisor of \(a-(b\cdot q)\) and \(b\text{.}\)