Least Common Multiple (LCM) and Greatest Common Divisor (GCD) appear to be opposite operations, yet they are deeply bound by the laws of prime factorization. By breaking any integer down into its primary building blocks, prime numbers, you can solve both LCM and GCD in a single unified step.
In this mathematical deep dive, we will explain the profound link between factors, multiples, and prime factorizations, and how a Venn diagram makes this connection visually intuitive.
The Prime Factorization Method
To find the LCM and GCD of 12 and 18, we first find their prime factorizations using our Prime Factorization Calculator:
12 = 2^2 * 3^118 = 2^1 * 3^2
Now, we apply two simple, elegant rules:
- For GCD (Greatest Common Divisor): Take the lowest power of each common prime factor.
GCD = 2^1 * 3^1 = 6. (Confirm this via our GCD Calculator). - For LCM (Least Common Multiple): Take the highest power of all prime factors present.
LCM = 2^2 * 3^2 = 4 * 9 = 36.
The Fundamental Formula: LCM * GCD = a * b
For any two positive integers a and b, the product of their LCM and GCD is always equal to the product of the two numbers themselves:
LCM(a, b) * GCD(a, b) = a * b
Let's verify with 12 and 18: 36 * 6 = 216, and 12 * 18 = 216. It matches perfectly! This formula is a powerful diagnostic tool used by our backend to verify results instantly.
Visualizing with Venn Diagrams
Imagine two overlapping circles. The left circle holds the prime factors of 12, and the right circle holds the prime factors of 18. The overlapping region holds the shared factors (one 2 and one 3).
The GCD is the product of the primes in the overlapping region: 2 * 3 = 6.
The LCM is the product of *all* prime factors in the diagram: 2 * (2 * 3) * 3 = 36.
| Prime | In 24 | In 36 | GCF (lower) | LCM (higher) |
|---|---|---|---|---|
| 2 | 2³ | 2² | 2² | 2³ |
| 3 | 3¹ | 3² | 3¹ | 3² |
| Result | 24 = 2³·3 | 36 = 2²·3² | 12 | 72 |
The unifying formula
Prime factorization shows the GCF and LCM are two halves of the same idea. For each prime, the GCF takes the lower exponent and the LCM takes the higher. Because every prime's two exponents are split between "lower" and "higher", multiplying the GCF and LCM uses each exponent exactly once — which is precisely the product of the original numbers. That is the elegant identity LCM(a, b) × GCF(a, b) = a × b. For 24 and 36, GCF = 12 and LCM = 72, and 12 × 72 = 864 = 24 × 36.
Why it always holds
The identity is not a coincidence but a direct consequence of unique prime factorization. Take any prime appearing with exponents m and n in the two numbers. The GCF contributes min(m, n) copies and the LCM contributes max(m, n); together that is min + max = m + n copies — exactly what the product a × b contributes. Since this balances for every prime, the GCF and LCM multiply to the product. This is why finding the fast-to-compute GCF immediately yields the LCM, the trick the LCM Calculator and GCD Calculator rely on.
Worked example: 24 and 36 through their primes
Prime factorization reveals the LCM and GCD at a glance. Write 24 = 2³ × 3 and 36 = 2² × 3². For the GCD, take the lowest power of each shared prime: 2² × 3 = 12. For the LCM, take the highest power of every prime: 2³ × 3² = 72. Notice 12 × 72 = 864 = 24 × 36 — the famous identity in action.
Why LCM × GCD = the product
The identity falls straight out of the prime view. For each prime, the LCM uses the higher exponent and the GCD uses the lower one. Adding the higher and the lower exponents gives exactly the sum of the two original exponents — which is the exponent in the product a × b. Doing this for every prime shows LCM(a, b) × GCD(a, b) = a × b for any pair. This is also why, once you know the GCD, the LCM is a one-line division: LCM = (a × b) ÷ GCD.
- Prime factorization is the ultimate bridge that connects LCM and GCD.
- GCD is found by multiplying the lowest powers of common prime factors.
- LCM is found by multiplying the highest powers of all prime factors present.
- The product of LCM and GCD always equals the product of the two input numbers.
Frequently asked questions
How does prime factorization give both the LCM and GCD?
Factor each number into primes. Take the highest power of each prime for the LCM and the lowest power of each shared prime for the GCD.
Why does LCM times GCD equal the product of the numbers?
For each prime, the higher and lower exponents used by the LCM and GCD add up to the total in the product, so multiplying LCM by GCD reconstructs a × b.
Can I get the LCM from the GCD?
Yes. Once you know the GCD, the LCM is simply (a × b) divided by the GCD — a quick one-step calculation.
Related articles
LCM vs GCF: What's the Difference? (With Examples)
LCM and GCF are easy to confuse. Learn the difference between the Least Common Multiple and the Greatest Commo…
Prime Factorization Explained: From Factor Trees to Cryptography
What is prime factorization, how do you do it with a factor tree, and why does it matter? A complete, beginner…
What Are Prime Numbers? A Complete Beginner's Guide
A clear beginner's guide to prime numbers: the definition, why 1 isn't prime, how to test for primes, famous p…