The greatest common divisor of positive integers is the largest positive integer dividing both, denoted . The set of positive common divisors contains and is finite, so this definition supplies a value.
The Euclidean algorithm repeatedly replaces by , where the new remainder lies between and . Common divisors are unchanged by this subtraction, and decreasing positive remainders ensure termination. The last nonzero remainder is the greatest common divisor.
The extended Euclidean algorithm also tracks coefficients , beginning with coefficient pairs and and applying the same subtraction to the pairs. This invariant produces Bézout coefficients for the last nonzero remainder. Here the divisions are
Back substitution gives
Thus , with and in Bézout's identity.

Articles by others on the same topic (0)

There are currently no matching articles.