When you first meet the identity
(where HCF is the highest common factor — the same thing as GCD — and LCM is the least common multiple), it looks like one of those party tricks your teacher performs and you learn to apply. Numbers line up, the answer falls out, you move on. But the identity is not a coincidence and not a party trick. It is forced by the structure of prime factorisation — and once you see why, you will never forget it.
This article explains why the identity is true, why it is restricted to pairs of numbers (it breaks for three or more), and how to use it as a shortcut when one of HCF or LCM is much easier to find than the other.
The key identity, in exponents
Every positive integer can be written as a product of primes raised to powers. For two numbers a and b:
(where any exponent can be zero if that prime doesn't appear). Then, prime by prime:
Multiply them, prime by prime:
Here is the magic. For any two numbers x and y, \min(x, y) + \max(x, y) = x + y. One of them is the smaller and the other the larger, and their sum is the same regardless of which you call which. So:
But that product of p^{a_i + b_i} terms is exactly a \cdot b:
Match. So \text{HCF}(a, b) \cdot \text{LCM}(a, b) = a \cdot b — and the identity is a direct consequence of one simple fact about \min and \max.
Why \min(x, y) + \max(x, y) = x + y: however you label the two numbers, the smaller one plus the larger one is the same thing as the first plus the second. There is no other arithmetic going on — it is just a book-keeping identity.
A worked example: a = 12, b = 18
Factorise: 12 = 2^2 \cdot 3^1 and 18 = 2^1 \cdot 3^2.
Take minima and maxima of exponents:
| Prime | Exponent in 12 | Exponent in 18 | \min | \max | Sum (min + max) |
|---|---|---|---|---|---|
| 2 | 2 | 1 | 1 | 2 | 3 |
| 3 | 1 | 2 | 1 | 2 | 3 |
HCF = 2^1 \cdot 3^1 = 6. LCM = 2^2 \cdot 3^2 = 36. HCF × LCM = 6 \times 36 = 216. a \times b = 12 \times 18 = 216. \checkmark
Notice that in the table, at every prime, \min + \max equals the sum of the two original exponents. That is the arithmetic foundation of the identity.
Interactive: verify across different pairs
Why this makes the identity useful
If you know any two of \{\text{HCF}, \text{LCM}, a \cdot b\}, you know the third. Concretely:
- If you have a, b, and HCF, then \text{LCM} = \dfrac{a \cdot b}{\text{HCF}}.
- If you have a, b, and LCM, then \text{HCF} = \dfrac{a \cdot b}{\text{LCM}}.
The Euclidean algorithm computes HCF quickly (without factoring). Then dividing ab by HCF gives LCM instantly. You never need to factor.
Example. a = 252, b = 105. Euclidean algorithm gives \text{HCF}(252, 105) = 21. Then:
Done in one division. No factoring needed.
Why the identity breaks for three numbers
Sadly, the identity \text{HCF}(a,b) \cdot \text{LCM}(a,b) = ab does not generalise to three numbers. It is tempting to think:
But this fails in general. Here is a small counterexample with a = 2, b = 3, c = 6:
- \text{HCF}(2, 3, 6) = 1
- \text{LCM}(2, 3, 6) = 6
- \text{HCF} \cdot \text{LCM} = 1 \cdot 6 = 6
- a \cdot b \cdot c = 36
6 \neq 36. The identity fails.
The reason: with two numbers, at each prime there are only two exponents, and \min + \max = their sum. With three numbers, you have three exponents x, y, z, and there is no clean identity of the form \min(x, y, z) + \max(x, y, z) = x + y + z — you are missing the middle exponent. For \{2, 1, 1\}: \min = 1, \max = 2, \min + \max = 3, but 2 + 1 + 1 = 4. Off by 1.
The general three-number formula is:
— a mess, and not a useful identity. Two numbers are special because \min and \max cover all the information among two values. (See Does gcd × lcm = product Work for Three Numbers? (No — and Here's Why) for the full breakdown.)
A second way to see the identity
Here is a more elementary argument that avoids prime factorisation.
Let d = \text{HCF}(a, b) and m = \text{LCM}(a, b). By definition, d divides both a and b, so write a = d a' and b = d b' with \text{HCF}(a', b') = 1 (the co-prime part). Also, m = d a' b' (because the LCM "covers" both by multiplying the co-prime parts together).
Now:
Clean. The identity falls out from the pairing between HCF and LCM, mediated by the co-prime quotients a' = a/d and b' = b/d.
Example: Use the identity to find LCM without factoring
Problem. Find \text{LCM}(480, 360).
Step 1. Compute \text{HCF}(480, 360) via Euclidean algorithm.
480 = 1 \times 360 + 120. 360 = 3 \times 120 + 0. HCF = 120.
Why Euclidean algorithm: it avoids factoring — a huge speed advantage for bigger numbers. Each step replaces the larger number with the remainder; the last non-zero remainder is the HCF.
Step 2. Apply the identity:
Step 3. Verify by factorisation (sanity check).
480 = 2^5 \times 3 \times 5 and 360 = 2^3 \times 3^2 \times 5. LCM = 2^5 \times 3^2 \times 5 = 32 \times 9 \times 5 = 1440. \checkmark
Result. \text{LCM}(480, 360) = 1440.
The identity turned a factorisation-heavy computation into a single division. For competition problems where the numbers are designed to have complicated factorisations, this trick is a massive time-saver.
The one-line takeaway
At every prime, \min(a_i, b_i) + \max(a_i, b_i) = a_i + b_i — no matter which exponent is bigger. So the HCF (using mins) and LCM (using maxes) multiply, prime by prime, to give back exactly a \cdot b (using sums). The identity is not a coincidence but a direct consequence of how \min and \max partition a pair of numbers.
Related: Number Theory Basics · Does gcd × lcm = product Work for Three Numbers? · Factor Clock — Divisors of n · GCD Shrinking Game · Factors vs Multiples