Extended Euclidean Algorithm

Finds integers x and y with ax + by = the greatest common divisor. Running the Euclidean algorithm while also tracking how many of a and of b each remainder holds leaves x and y behind once the division comes out even. This is the basis for solving linear Diophantine equations.