ExtendedGCD[n1,n2,…]
gives the extended greatest common divisor of the integers ni.
ExtendedGCD
ExtendedGCD[n1,n2,…]
gives the extended greatest common divisor of the integers ni.
Details
- Integer mathematical function, suitable for both symbolic and numerical manipulation.
- ExtendedGCD[n1,n2,…] returns a list
where g is GCD[n1,n2,…] and
. - ExtendedGCD automatically threads over lists.
Examples
open all close allBasic Examples (2)
Scope (1)
ExtendedGCD threads element-wise over lists:
ExtendedGCD[3, {5, 15}]Properties & Relations (1)
The first element of ExtendedGCD is the GCD:
ExtendedGCD[6, 21]GCD[6, 21]Neat Examples (1)
ArrayPlot[Table[Last[ExtendedGCD[m, n]], {m, 100}, {n, 100}], ColorFunction -> Hue]See Also
GCD Reduce HermiteDecomposition SmithDecomposition PolynomialExtendedGCD
Function Repository: HalfGCD
Tech Notes
Related Guides
Related Links
History
Introduced in 1988 (1.0) | Updated in 2003 (5.0)
Text
Wolfram Research (1988), ExtendedGCD, Wolfram Language function, https://reference.wolfram.com/language/ref/ExtendedGCD.html (updated 2003).
CMS
Wolfram Language. 1988. "ExtendedGCD." Wolfram Language & System Documentation Center. Wolfram Research. Last Modified 2003. https://reference.wolfram.com/language/ref/ExtendedGCD.html.
APA
Wolfram Language. (1988). ExtendedGCD. Wolfram Language & System Documentation Center. Retrieved from https://reference.wolfram.com/language/ref/ExtendedGCD.html
BibTeX
@misc{reference.wolfram_2026_extendedgcd, author="Wolfram Research", title="{ExtendedGCD}", year="2003", howpublished="\url{https://reference.wolfram.com/language/ref/ExtendedGCD.html}", note=[Accessed: 12-June-2026]}
BibLaTeX
@online{reference.wolfram_2026_extendedgcd, organization={Wolfram Research}, title={ExtendedGCD}, year={2003}, url={https://reference.wolfram.com/language/ref/ExtendedGCD.html}, note=[Accessed: 12-June-2026]}