WLJS LogoWLJS Notebook

GCD

GCD[n1, n2, ...] gives the greatest common divisor of the integers.

Examples

Find GCD of two numbers:

GCD[12, 18]
(* 6 *)

GCD of multiple numbers:

GCD[24, 36, 48]
(* 12 *)

GCD of coprime numbers:

GCD[7, 11]
(* 1 *)

Please visit the official Wolfram Language Reference for more details.

On this page