LCM or Least Common Multiple
Enter numbers separated by space(s).
LCM = 15
3 = `3` calculator
5 = `5` calculator
For each factor, choose the greatest exponent in above factorizations,
LCM = `3 * 5` = 15
Request help on this calculationDo you have any suggestions to improve this page ?
What is LCM ?
The LCM (or Least Common Multiple) of two (or more) non zero integers is the smallest positive common multiple of these numbers.
How to calculate the LCM?
There are several methods to calculate LCM.
This is the method that derives directly from the definition.
• List the multiples of the integers in question (you may use this calculator Find multiples of a number).
• The LCM is the smallest common number to these two lists.
Example 1. What is the LCM of 6 and 21?
The smallest common number of these bumbers is 42. So,
LCM (6, 21) = 42
Example 2. what is the LCM of 28 and 42 ?
The smallest common number of these two lists is 84. So,
LCM (28, 42) = 84
This method is not recommended because it requires calculating multiples of the integers, which can be long and tedious for large numbers. The two methods below are faster.
Example. What is the LCM of 48 and 42 ?
• Factor the two numbers
• Calculate the LCM from the two integers prime factorization.
LCM factors will be the same factors that are present in either 48 or 42 prime factorizations.
LCM factors are therefore the union of the two factors sets: 2, 7 and 3
Each factor will have the largest exponent in the two decompositions. Thus,
2 will have an exponent of 4 (since 4 > 1 ).
3 will have an exponent of 1 (same exponent in the two decompositions).
7 will have an exponent of 1 (present only in 42).
`LCM (48, 42) = 2^4 * 3* 7 = 336`
This method uses the following formula:
`LCM (a, b)*GCD (a,b) = a*b`
`LCM (a,b)=(a*b)/(GCD (a, b))`
We calculate LCM from GCD by using this formula.
Applied to above example,
`LCM(48,42)=(48*42)/6 = 336`
LCM Properties (Advanced)
Let a and b be two non-zero integers then,
• if b is a divisor of a, then the LCM of a and b is equal to a.
• if a or b is zero, LCM (a, b) = 0
• GCD (a, b) divides LCM (a, b)
• If we multiply a and b by the same positive integer k then their LCM is multiplied by k.
LCM (k.a, k. b) = k . LCM (a, b)
• GCD (a, b) x LCM (a, b) = |a x b|
• a and b are two positive coprime integers if and only if LCM (a , b) = a x b.
ProgrammingHere is a program that computes the LCM of two integers.
def lcm (x, y): # we calculate the maximum of x and y if x > y: max = x else: max = y while (True): if ((max % x == 0) and (max % y == 0)): lcm = max break max += 1 return lcm