If I know the GCD of 20 numbers, and know the 20 numbers, is there a formula such that I input the 20 numbers and input their GCD, and it outputs their LCM? I know that $$\frac{\left| a\cdot b\right|}{\gcd(a,b)} = \text{lcm}(a,b).$$ So is it$$\frac{\left| a\cdot b\cdot c\cdot d\cdot e\cdot f\right|}{\gcd(a,b,c,d,e,f)}?$$If not, what is it?
GCD to LCM of multiple numbers
19.7k Views Asked by Bumbble Comm https://math.techqa.club/user/bumbble-comm/detail AtThere are 4 best solutions below
On
If you are asking whether the identity $\dfrac{|a_1a_2\cdots a_n|}{\gcd(a_1,a_2,\ldots,a_n)}=\text{lcm}(a_1,a_2,\ldots,a_n)$ is true for $n>2$ then the answer is no.
Take for example $n=3, a_1=2, a_2=4,a_3=3$.
On
It certainly doesn't work like that. Consider that $\gcd(1, 2, 2) = 1$, $\text{lcm}(1, 2, 2) = 2$ and $1 \times 2 \times 2 = 4$.
A good way to think of this is to consider a natural number $n$ as a vector which has $x$ for $i$th component if $x$ is the largest power of $i$th prime, dividing $n$. For example, $50 = 2\times 5^2$ would be $(1, 0, 2, 0, 0 \dots)$. Then $\gcd$ is a componentwise $\min$, $\text{lcm}$ is a componentwise $\max$ and $\times$ is a componentwise $+$. It just so happens that for two numbers, $\min(a, b) + \max(a, b) = a+b$. Same is not true for three or more numbers.
Using the same interpretation, you can construct many other similar formulas though. For example, $\text{lcm}(a, b, c, \dots) = \text{lcm}(a, \text{lcm}(b, \text{lcm}(c, \dots)))$.
On
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.
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).