What is the Least Common Multiple (LCM)?
The Least Common Multiple (LCM)—sometimes called the lowest common multiple or smallest common multiple—of two or more non-zero integers is the smallest positive integer that is an exact multiple of all given numbers. In other words, it is the lowest number that can be divided by each of the inputs without leaving any remainder.
The most important real-world mathematical application of the LCM is finding the Least Common Denominator (LCD) when adding or subtracting fractions with unlike denominators. For example, to evaluate 1/12 + 1/18, you find the LCM of 12 and 18 (which is 36) to rewrite the fractions with equal denominators: 3/36 + 2/36 = 5/36.
What is the Greatest Common Divisor (GCD / GCF)?
The Greatest Common Divisor (GCD)—also universally known as the Greatest Common Factor (GCF), highest common factor (HCF), or greatest common denominator—is the largest positive integer that divides each of the numbers with a remainder of zero.
The GCD is essential for simplifying algebraic expressions, reducing fractions to their irreducible lowest terms, and cryptography algorithms (including the RSA public-key cryptosystem and Diffie-Hellman key exchange).
How to Calculate GCD and LCM: Comparison of Methods
| Calculation Method | Best Used For | Computational Complexity | How It Works |
|---|---|---|---|
| Euclidean Algorithm | Large numbers & programming | O(log(min(a, b))) — Extremely Fast | Divides larger number by smaller and takes remainder until zero is reached. |
| Prime Factorization | School algebra & teaching | Requires finding prime factors | Expresses numbers as prime powers: GCD takes min exponents, LCM takes max exponents. |
| Listing Method | Small numbers (under 50) | Manual inspection | Lists factors to find the largest common one; lists multiples to find the smallest common one. |
The Fundamental Mathematical Formula Linking GCD and LCM
For any two positive integers a and b, their greatest common divisor and least common multiple are directly linked by an elegant theorem:
GCD(a, b) × LCM(a, b) = a × b
Because of this identity, once you compute the GCD using Euclid's algorithm, calculating the LCM requires only a single multiplication and division:
LCM(a, b) = (a × b) / GCD(a, b)
LCM and GCD Quick Reference Chart
| Number Pair | Greatest Common Divisor (GCD) | Least Common Multiple (LCM) | Prime Factorization Breakdown |
|---|---|---|---|
| 12 and 18 | 6 | 36 | 12 = 2² × 3 | 18 = 2 × 3² |
| 8 and 12 | 4 | 24 | 8 = 2³ | 12 = 2² × 3 |
| 15 and 25 | 5 | 75 | 15 = 3 × 5 | 25 = 5² |
| 24 and 36 | 12 | 72 | 24 = 2³ × 3 | 36 = 2² × 3² |
| 14 and 21 | 7 | 42 | 14 = 2 × 7 | 21 = 3 × 7 |
| 48 and 180 | 12 | 720 | 48 = 2⁴ × 3 | 180 = 2² × 3² × 5 |
Frequently Asked Questions
LCM(a, b) = a * b.