The extended Euclidean Algorithm made easy

Teaching Notes The extended Euclidean Algorithm made easy The Euclidean algorithm [1] calculates the greatest common divisor (GCD) of two integers and . A theorem by Bézout and Bachet asserts that this GCD can be written as a linear combination of and : a b a b GCD (a, b) = x × a + y × b with and integers. The extended Euclidean Algorithm calculates and also and . One of the implementations of this algorithm is due to Donald Knuth [1, 2]. It works just fine if you use a computer, but if you want to do the calculations by hand this is not the method to use. x y GCD (a, b) x y