Skip to content

XGCD ​

The extended Euclidean algorithm -- (g,x,y)(g, x, y) with g=gcd⁡(a,b)=ax+byg = \gcd(a, b) = ax + by.

FungrimXGCDFungrim entry
XGCD(a, b) -> Tuple(g, x, y)Bezout coefficients alongside the gcd
Typed signatures
TypePackageApplies
(integer, integer) -> tuple<integer, integer, integer>analyticalways

Domain: Number theory

Examples

Basic #

gcd⁡(240,46)=2=240⋅(−9)+46⋅47\gcd(240, 46) = 2 = 240\cdot(-9) + 46\cdot47

live ↗
InXGCD(240,46)\mathrm{XGCD}(240, 46)Out(2,−9,47)(2,-9,47)
About
Examples1
CrosswalkFungrimFungrim entry ×8

See also: GCD, ExtendedGCD