Relatively Prime Calculator

Enter whole numbers to test whether they are coprime.

2 to 10 whole numbers of 1 or more, separated by commas.

Try

Result

You enteredgcd⁡(12,  18)\gcd\left(12,\; 18\right)

No, gcd⁡(12,  18)=6\displaystyle \text{No, } \gcd\left(12,\; 18\right) = 6

Greatest common divisor

6\displaystyle 6

Least common multiple

36\displaystyle 36
Show the work
  1. Coprime numbers share no prime factor

    Numbers are relatively prime (coprime) when no whole number bigger than 1 divides all of them, which means their greatest common divisor is 1.

    Using gcd⁡(a,b)=1\gcd(a, b) = 1

    gcd⁡(12,  18)=?1\gcd\left(12,\; 18\right) \overset{?}{=} 1
  2. Euclidean algorithm

    Divide the larger number by the smaller and keep the remainder; repeat with the smaller number and the remainder. The last non-zero remainder is the greatest common divisor.

    18=1×12+612=2×6+0\begin{array}{l} 18 = 1 \times 12 + 6 \\ 12 = 2 \times 6 + 0 \end{array}
  3. Result

    No, gcd(12, 18) = 6.

Worked examples