The greatest common divisor is the largest positive integer dividing both and . Its partner, the least common multiple , is the smallest positive integer that both and divide.
Factoring is slow for large numbers. The Euclidean algorithm finds instantly using the rule: where is the remainder of .
| Step | Division | Remainder () |
|---|---|---|
| 1 | ||
| 2 | ||
| 3 |
Repeatedly replace with until . The last nonzero remainder is the gcd. Here, .
Coprime and the LCM Link
Two numbers are coprime (relatively prime) when , meaning they share no prime factors. This is essential for finding multiplicative inverses in modular arithmetic.
You can find the lcm instantly without factoring using the identity: Rearranging gives .
Common Pitfall: Never confuse the two terms:
| Property | GCD | LCM |
|---|---|---|
| Meaning | Divisor of both | Multiple of both |
| Bound | At most the smaller | At least the larger |
| Example |