GCD to LCM of multiple numbers

There can be no formula that computes $\text{lcm}(a,b,c)$ using only the values of $abc$ and $\gcd(a,b,c)$ as input: that's because $(a,b,c) = (1,2,2)$ and $(a,b,c) = (1,1,4)$ both have $abc=4$, $\gcd(a,b,c)=1$, but they don't have the same lcm.

However, there is a straightforward generalization of the $2$-variable formula. For instance, $$\text{lcm}(a,b,c,d) = \frac{abcd}{\gcd(abc,abd,acd,bcd)}.$$

The correct gcd to take is not of the individual terms $a,b,c,d$ but the products of all the complementary terms (which looks the same in the two-variable case).


As mentioned, it does not generalize like that. But there do exist generalizations. For example, using the standard gcd notation $\rm\ (x,y,\ldots)\, :=\, gcd(x,y,\ldots),\:$ we have

Theorem $\rm\ \ lcm(a,b,c)\, =\, \dfrac{abc}{(bc,ca,ab)}$

$\!\begin{align}{\bf Proof}\qquad\qquad\rm\ a,b,c&\mid\rm\ n\\ \iff\quad\rm abc&\mid \rm\,\ nbc,nca,nab\\ \iff\quad\rm abc&\mid \rm (nbc,nca,nab)\, =\, n(bc,ca,ab)\\ \iff\rm \ \dfrac{abc}{(bc,ca,ab)} &\:\Bigg| \rm\,\ n\end{align}$

Hence the claimed equality follows by the (universal) definition of lcm. $\ \ $ QED

Remark $\ $ The penultimate equivalence in the proof uses said (universal) definition of gcd, followed by the gcd distributive law. An analogous proof works for any number of arguments.


$$\operatorname{lcm}(a,b)=\frac{a\cdot b}{\operatorname{gcd}(a,b)};$$ $$\operatorname{lcm}(a,b,c)=\frac{a\cdot b\cdot c\cdot \operatorname{gcd}(a,b,c)}{\operatorname{gcd}(a,b)\cdot \operatorname{gcd}(a,c)\cdot \operatorname{gcd}(b,c)};$$ $$\operatorname{lcm}(a,b,c,d)=\frac{a\cdot b\cdot c\cdot d\cdot\operatorname{gcd}(a,b,c)\cdot\operatorname{gcd}(a,b,d)\cdot\operatorname{gcd}(a,c,d)\cdot\operatorname{gcd}(b,c,d)}{\operatorname{gcd}(a,b)\cdot\operatorname{gcd}(a,c)\cdot\operatorname{gcd}(a,d)\cdot\operatorname{gcd}(b,c)\cdot\operatorname{gcd}(b,d)\cdot\operatorname{gcd}(c,d)\cdot\operatorname{gcd}(a,b,c,d)};$$ etc. This is because $$\max(a,b)=a+b-\min(a,b);$$ $$\max(a,b,c)=a+b+c-\min(a,b)-\min(a,c)-\min(b,c)+\min(a,b,c);$$ $$\max(a,b,c,d)=a+b+c+d-\min(a,b)-\min(a,c)-\min(a,d)-\min(b,c)-\min(b,d)-\min(c,d)+\min(a,b,c)+\min(a,b,d)+\min(a,c,d)+\min(b,c,d)-\min(a,b,c,d);$$ etc. This is the "in-and-out" principle, aka "The Principle of Inclusion and Exclusion".