Overview
The Extended Euclidean Algorithm follows the Euclidean remainder sequence while tracking coefficients x and y such that a*x + b*y equals the current remainder.
Computes a greatest common divisor together with coefficients satisfying Bezout's identity.
Compact metadata for implementation and discovery.
The Extended Euclidean Algorithm follows the Euclidean remainder sequence while tracking coefficients x and y such that a*x + b*y equals the current remainder.
Quick facts
Runtime and memory behavior at a glance.
Best
O(1)
Average
O(log min(a, b))
Worst
O(log min(a, b))
Space
O(1)
a*x + b*y = gcd(a,b)Tracks coefficients that express the greatest common divisor.
Show tracking coefficient updates alongside Euclidean remainders on a small bezout coefficient computation example.
The coefficient result is not unique, but any valid pair can be used for modular inverses and Diophantine equations.
What each reference supports for this entry.
Reference for Extended Euclidean Algorithm's arithmetic operations, modular arithmetic, multiplication, division, or number-theoretic implementation details.
Open sourceTextbook support for Extended Euclidean Algorithm's algorithm family, complexity framing, and standard implementation concepts.
Open sourceGood next jumps from the relationship graph, ranked for useful discovery.
Numerical Methods · Core
Extended Euclid also tracks Bezout coefficients; binary GCD only returns the gcd.
Compare with thisNumerical Methods · Foundation
Extended Euclid follows the same remainder sequence as the Euclidean algorithm.
Compare with thisCryptography · Core
Montgomery setup can use modular inverses for the radix and modulus.
Compare with thisCryptography · Foundation
Modular inverses and modular powers often appear together in number-theory code.
Compare with thisExtended Euclid follows the same remainder sequence as the Euclidean algorithm.
Chinese remainder constructions commonly need modular inverses from extended Euclid.
Modular inverses and modular powers often appear together in number-theory code.