Here is a tempting mistake that even standard textbooks occasionally print. For two positive integers, there is a beautiful identity:
It is clean, it is useful, and it has a satisfying symmetry. So the instinct is to generalise: surely for three numbers,
This is false. And the way it fails is instructive — it exposes exactly what \gcd and \operatorname{lcm} are actually doing at the level of prime exponents, and why the two-number identity was special.
A single counterexample settles it
Take a = 4, b = 6, c = 8.
- \gcd(4, 6, 8) = 2 (the largest integer dividing all three).
- \operatorname{lcm}(4, 6, 8) = 24 (the smallest integer that is a multiple of all three).
- \gcd \cdot \operatorname{lcm} = 2 \cdot 24 = 48.
- a \cdot b \cdot c = 4 \cdot 6 \cdot 8 = 192.
48 \neq 192. The identity fails by a factor of 4.
You only need one counterexample to knock out an identity, but let us understand why — because understanding why is what prevents you from making this slip on an exam.
What the two-number identity really says
At the level of prime factorisations, \gcd and \operatorname{lcm} operate on exponents, not on the numbers themselves. Write a and b using a shared list of primes:
Then:
So at each prime p:
This uses the simple identity \min(x, y) + \max(x, y) = x + y. For two numbers, min and max partition the pair — one value takes the min, the other takes the max, and nothing is left out. The total count at each prime is preserved.
What breaks for three numbers
Now write three numbers:
At each prime p:
- v_p(\gcd(a,b,c)) = \min(a_p, b_p, c_p).
- v_p(\operatorname{lcm}(a,b,c)) = \max(a_p, b_p, c_p).
- v_p(abc) = a_p + b_p + c_p.
The would-be identity \gcd \cdot \operatorname{lcm} = abc demands:
But there is a middle value left over. For three numbers, the min takes the smallest, the max takes the largest, and the median value is ignored. The correct accounting is:
not \min + \max. The gap is exactly the median.
Checking the counterexample prime-by-prime
Return to a = 4, b = 6, c = 8. Factorisations:
- 4 = 2^2. So v_2(4) = 2, v_3(4) = 0.
- 6 = 2 \cdot 3. So v_2(6) = 1, v_3(6) = 1.
- 8 = 2^3. So v_2(8) = 3, v_3(8) = 0.
At p = 2: exponents are (2, 1, 3). Min = 1, median = 2, max = 3. Sum is 6; min+max is 4. Gap of 2 (the median).
At p = 3: exponents are (0, 1, 0). Min = 0, median = 0, max = 1. Sum is 1; min+max is 1. No gap at this prime (the median is zero here).
Total gap across all primes: 2 (from p = 2). So
which matches our 192 / 48 = 4 from the direct calculation. The discrepancy is exactly the missing median factor at the prime 2.
When does the identity accidentally still hold?
The identity holds when at every prime p, the median exponent equals the min (or equivalently, the median equals the max — the three values collapse into two). That is, when at each prime p, at least two of a_p, b_p, c_p agree on which is smallest.
For example, a = 2, b = 3, c = 5 (pairwise co-prime). At p = 2: exponents (1, 0, 0), min = 0, median = 0, max = 1. Median = min, gap = 0. Same at p = 3 and p = 5. So:
Rule of thumb. If the three numbers are pairwise co-prime, the identity holds trivially (\gcd = 1 and \operatorname{lcm} = abc). For any three numbers sharing a non-trivial common structure, the identity almost always fails.
The correct generalisation
For three numbers, there is a valid inclusion-exclusion-style identity:
This comes from inclusion-exclusion applied to \max in terms of \min:
Exponentiated, this becomes the formula above. For a = 4, b = 6, c = 8:
- \gcd(4,6) = 2, \gcd(6,8) = 2, \gcd(8,4) = 4.
- \gcd(4,6,8) = 2, abc = 192.
- \operatorname{lcm} = \dfrac{192 \cdot 2}{2 \cdot 2 \cdot 4} = \dfrac{384}{16} = 24. \checkmark
The correct identity has four factors on top and three on bottom — not the clean two-factor symmetry of the two-variable case. Generalising to n numbers requires full inclusion-exclusion and rapidly becomes unwieldy.
The bigger lesson
Clean identities are sometimes special cases of deeper structure, not templates to copy. The two-variable \gcd \cdot \operatorname{lcm} = ab works because \min + \max is a complete accounting of two values. Three values introduce a middle term that the simple identity cannot see.
When you want to generalise, go back to the reason the original worked. Here the reason was a statement about numbers: \min(x, y) + \max(x, y) = x + y. That statement is true for two numbers. It is false for three. Everything else follows.
Related: Number Theory Basics · Why the Euclidean Algorithm Terminates · Why One is Not a Prime Number · The Euclidean Algorithm as Rectangle-Tiling · Number Systems