The LCM of any two numbers can be found with the following formula:
LCM(a,b) = (ab) / GCD (a,b).
The GCD of two numbers is best found with the Euclidean algorithm which is as follows:
GCD(a,b) =
a --if b = 0
or GCD(b, a mod b) otherwise
In the example given we have GCD(42,7) = GCD(7, 0) = 7
Then LCM(42,7) = (7*42)/7 = 42
Note: mod is the operation of dividing one number by another and taking the remainder. e.g. 7 mod 4 = 3, 12 mod 6 = 0.
Chat with our AI personalities