Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

GCD and LCM relation

The following relation works only for two (3, 12) numbers, it fails to produce the right answer when used for three numbers (3,12,10) . Just wondering if is it my understanding or it is just for two numbers and for me same is true for Euclid algorithm as well.

LCM(a, b) = (a x b) / GCD(a,b) or GCD(a,b) = (a x b) / LCM(a, b) 
like image 964
Abidi Avatar asked Apr 10 '11 12:04

Abidi


1 Answers

The analogous formulas to

LCM(a, b) = (a x b) / GCD(a,b) or GCD(a,b) = (a x b) / LCM(a, b) 

with three variables are simply not valid, as your example with (3, 12, 10) shows readily.

The product of these three numbers is 360. The GCD is 1. The LCM is 60.

like image 160
Don Roby Avatar answered Nov 10 '22 12:11

Don Roby