1

I was doing this problem on codeforces, and as I was trying to simplify the formula, I arrived at the above conclusion. But now that I think of it, I actually arrived at that conclusion by mistake. Here are my workings.
$$ GCD\bigl(( LCM(a,b) , LCM(a,c)\bigr) \\\\=> a \times GCD\left( \frac{b}{GCD(a,b)} , \frac{c}{GCD(a,c)} \right) \\\\=> \frac{a \times GCD(b,c)}{GCD\bigl( GCD(a,b) , GCD(a,c)\bigr)} \\\\=> \frac{a \times GCD(b,c)}{GCD(a,b,c)} \\\\=> \frac{a \times GCD(b,c)}{GCD\bigl(a, GCD(b,c)\bigr)} \\\\=> LCM\bigl(a , GCD(b,c)\bigr) $$
I suspect that the third line is wrong since $GCD(hi,jk) != GCD(hj) \times GCD(ik)$. I know the final formula is correct since my submission was accepted.
So what is the correct way to arrive at the conclusion?

0 Answers0