Example7.42
Let us compute the greatest common divisor of \(945\) and \(2415\text{.}\) First observe that
\begin{align*} 2415 & = 945 \cdot 2 + 525\\ 945 & = 525 \cdot 1 + 420\\ 525 & = 420 \cdot 1 + 105\\ 420 & = 105 \cdot 4 + 0. \end{align*}Reversing our steps, \(105\) divides \(420\text{,}\) \(105\) divides \(525\text{,}\) \(105\) divides \(945\text{,}\) and \(105\) divides \(2415\text{.}\) Hence, \(105\) divides both \(945\) and \(2415\text{.}\) If \(d\) were another common divisor of \(945\) and \(2415\text{,}\) then \(d\) would also have to divide \(105\text{.}\) Therefore, \(\gcd( 945, 2415 ) = 105\text{.}\)
If we work backward through the above sequence of equations, we can also obtain numbers \(r\) and \(s\) such that \(945 r + 2415 s = 105\text{.}\) Observe that
\begin{align*} 105 & = 525 + (-1) \cdot 420\\ & = 525 + (-1) \cdot [945 + (-1) \cdot 525]\\ & = 2 \cdot 525 + (-1) \cdot 945\\ & = 2 \cdot [2415 + (-2) \cdot 945] + (-1) \cdot 945\\ & = 2 \cdot 2415 + (-5) \cdot 945. \end{align*}So \(r = -5\) and \(s= 2\text{.}\) Notice that \(r\) and \(s\) are not unique, since \(r = 41\) and \(s = -16\) would also work.