Wolfram ResearchPRODUCTSPURCHASEFOR USERSCOMPANYOUR SITES
THIS IS DOCUMENTATION FOR AN OBSOLETE PRODUCT.
SEE THE DOCUMENTATION CENTER FOR THE LATEST INFORMATION.

Documentation / Mathematica / Built-in Functions / Mathematical Functions / Number Theory /

Further Examples: ExtendedGCD

The first element in the output from ExtendedGCD[n, m] is the greatest common divisor of the integers n and m.

In[1]:=

Out[1]=

In[2]:=

Out[2]=

The second element is a pair of integers. The linear combination of n and m with these as coefficients gives the gcd.

In[3]:=

Out[3]=

These two numbers are relatively prime.

In[4]:=

Out[4]=

Therefore this linear combination gives .

In[5]:=

Out[5]=

ExtendedGCD works on Gaussian integers as well.

In[6]:=

Out[6]=

This checks the results.

In[7]:=

Out[7]=

In[8]:=

Out[8]=

In[9]:=

Out[9]=

This clears the definitions.

In[10]:=



Any questions about topics on this page? Click here to get an individual response.Buy NowMore Information


 © 2008 Wolfram Research, Inc.  Terms of Use  Privacy Policy | [ja] |
Sign up for our newsletter: