Extended Euclidean Algorithm Calculator

Find GCD and Bezout coefficients (x, y) such that ax + by = gcd(a, b).

Enter Numbers

Algorithm Steps

Stepqrst
0-24010
1-4601
25101-5
346-421
4145-26
512-947
62023-120

Algorithm

The extended algorithm finds x, y such that:

ax + by = gcd(a, b)

Recurrence relations:

rᵢ = rᵢ₋₂ - qᵢrᵢ₋₁

sᵢ = sᵢ₋₂ - qᵢsᵢ₋₁

tᵢ = tᵢ₋₂ - qᵢtᵢ₋₁

Greatest Common Divisor

GCD = 2

GCD
2
LCM
5520

Bezout Coefficients

x

-9

y

47

Bezout Identity

240 × (-9) + 46 × (47) = 2

Verification: Correct

Applications

  • Finding modular multiplicative inverse
  • Solving linear Diophantine equations
  • RSA cryptography key generation
  • Computing continued fractions