Mathematica 9 is now available
THIS IS DOCUMENTATION FOR AN OBSOLETE PRODUCT.
SEE THE DOCUMENTATION CENTER FOR THE LATEST INFORMATION.
Mathematica > Mathematics and Algorithms > Mathematical Functions > Number Theoretic Functions >

ExtendedGCD

ExtendedGCD[n1, n2, ...]
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_1n_1+r_2n_2+....
The extended greatest common divisor of 2 and 3:
Compute the extended GCD of several integers:
The extended greatest common divisor of 2 and 3:
In[1]:=
Click for copyable input
Out[1]=
In[2]:=
Click for copyable input
Out[2]=
 
Compute the extended GCD of several integers:
In[1]:=
Click for copyable input
Out[1]=
In[2]:=
Click for copyable input
Out[2]=
ExtendedGCD threads element-wise over lists:
The first element of ExtendedGCD is the GCD:
New in 1 | Last modified in 5
Ask a question about this page  |  Suggest an improvement  |  Leave a message for the team