
Extended Euclidean algorithm
The Extended Euclidean Algorithm is a method used to find the greatest common divisor (GCD) of two numbers and express it as a combination of those numbers. Think of it as identifying the largest number that divides both without leftovers, and also finding specific multiples of each original number that add up to this GCD. It works by repeatedly applying division and subtraction steps to break down the problem, keeping track of the coefficients that relate the GCD to the original pair. This is useful for solving equations involving divisibility and for computing modular inverses in number theory.