gives the extended greatest common divisor of the integers ni.


  • Integer mathematical function, suitable for both symbolic and numerical manipulation.
  • ExtendedGCD[n1,n2,] returns a list {g,{r_(1),r_(2),...}} where g is GCD[n1,n2,] and g=r_(1)n_(1)+r_(2)n_(2)+....
  • ExtendedGCD automatically threads over lists.


open allclose all

Basic Examples  (2)

The extended greatest common divisor of 2 and 3:

Compute the extended GCD of several integers:

Scope  (1)

ExtendedGCD threads element-wise over lists:

Properties & Relations  (1)

The first element of ExtendedGCD is the GCD:

Neat Examples  (1)

Introduced in 1988
Updated in 2003