How this calculation works
Adding b/g to x and subtracting a/g from y produces another valid pair, where g is the gcd.
ax + by = gcd(a,b)A worked example
30 × (−1) + 18 × 2 = 6.
Good to know
Several coefficient pairs can give the same gcd.
Reference: NIST DLMF, Functions of Number Theory (opens in a new tab) ↗
Read the result
Use the extended Euclidean algorithm to find one pair of integer coefficients.
The primary result is labeled “Greatest common divisor”. Keep the input definitions in view when comparing this result with another method.
Try a related calculation
Several coefficient pairs can give the same gcd.
For a related exercise, try the greatest common divisor.
A few questions, answered
How can I check the default inputs by hand?
30 × (−1) + 18 × 2 = 6.
Which rule does this calculator apply?
ax + by = gcd(a,b)