## About the calculator

This calculator can be used to calculate the least common multiple (lcm) of 2 or more numbers. Only numbers greater than 0 are accepted. It can be selected whether the calculation should be performed with the help of prime factorizations, series of multiples or the gcd calculated with the Euclidean algorithm.

## What is the least common multiple?

A number a is a multiple of a number b if there is an integer k such that a = k · b holds. If, in addition, it holds for a number c that there is an integer l such that a = l · c holds, then a is a common multiple of b and c. If there is no smaller number that is a common multiple of b and c, then a is the least common multiple of b and c.

## Lcm with prime factorization

Any integer greater than 1 can be represented as a product of primes. The individual numbers of this product are called prime factors.

For example, the number 270 can be represented as follows: 2 · 3 · 3 · 3 · 5

And the number 2352 can be represented as follows: 2 · 2 · 2 · 2 · 3 · 7 · 7

The prime factorizations can also be written down more compactly with powers:

Prime factorization for 270: 2 · 3^{3} · 5

Prime factorization for 2352: 2^{4} · 3 · 7^{2}

Now, for each number in the prime factorizations, look at in which prime factorization they have the higher exponent, and in that prime factorization, mark the number along with its exponent.

The 2 has the exponent 1 in the first prime factorization and the exponent 4 in the second. So 2^{4} is marked in the second prime factorization. The 3, on the other hand, has the higher exponent in the first prime factorization and is thus marked in the first prime factorization. 5 and 7 each occur in only one prime factorization and are therefore marked in this one.

Prime factorizations 270: 2 · 3^{3} · 5

Prime factorizations 2352: 2^{4} · 3 · 7^{2}

To get the least common multiple, the product of all marked powers must be calculated.

lcm(270, 2352) = 2^{4} · 3^{3} · 5 · 7^{2} = 105,840

## Lcm with series of multiples

In this method, you write down the multiples for both numbers, starting with the numbers themselves. If you want to determine the least common multiple of 2 numbers a and b, you have to calculate [1·a, 2·a, 3·a,...] and for b [1·b, 2·b, 3·b,...]. This is done until a number appears in both series. It is important to write down the multiples in the correct order, because otherwise there is no guarantee that the found multiple is the smallest multiple. You may omit multiples only if you can exclude that the lcm is among the omitted multiples. For example, if you want to calculate the kgV of 3 and 100, you don't necessarily have to calculate all multiples of 3 that are less than 100 because they can't be multiples of 100.

As an example, the least common multiple of 10 and 16 is to be determined.

Multiples of 10: [10, 20, 30, 40, 50, 60, 70, 80, 90, 100, ...]

Multiples of 16: [16, 32, 48, 64, 80, 96, ...]

The number 80 is the first number that occurs in both series and is therefore the smallest common multiple.

## Lcm with GCD

The least common multiple can also be determined with the help of the greatest common divisor. There is the following relationship between the greatest common divisor and the least common multiple:

If you now divide by the greatest common divisor, you get the following formula:

a∙b |

gcd(a, b) |

So, to calculate the lcm, you can first calculate the greatest common divisor (for example with the Euclidean algorithm) and the result is inserted into the formula.

As an example, the least common multiple of 10 and 16 is to be calculated. First calculate the greatest common divisor with the Euclidean algorithm:

16 | : | 10 | = | 1 | R | 6 |

10 | : | 6 | = | 1 | R | 4 |

6 | : | 4 | = | 1 | R | 2 |

4 | : | 2 | = | 2 | R | 0 |

Result: gcd(10, 16) = 2

Next, the result is used to calculate the lcm:

10∙16 |

gcd(10, 16) |

160 |

2 |

## lcm von mehr als 2 Zahlen

But how do you calculate the least common multiple of more than 2 numbers?

### with prime factorization:

The calculation of the smallest common multiple of more than 2 numbers with the prime factorization works in the same way as the calculation of the lcm of 2 numbers. One performs a prime factorization for each number, marks the power with the highest exponent for each number that occurs as the basis of at least one prime factorization and then forms the product of all marked powers.

### with series of multiples:

Also, calculating the least common multiple of more than 2 numbers with series of multiples works the same way as with 2 numbers. You calculate further multiples for all numbers until one multiple occurs in each row.

### with GCD

To calculate the lcm of 3 numbers a, b and c you can first calculate the lcm of a and b with the help of the GCD. Then calculate the lcm of the result and c to get the lcm of all 3 numbers. In this way, one can calculate the lcm of any number of numbers. Note that the order in which you calculate the least common multiples does not matter. You could also calculate the lcm of b and c first and then the lcm of the result and a.

#### Example:

As an example, we want to calculate the least common multiple of 4, 10, 15, and 18.

Step 1: First, the lcm of 4 and 10 is calculated with the help of the GCD. This is 20.

Step 2: Next, calculate the lcm of 20 and 15. This is 60.

Step 3: Then the lcm is calculated from 60 and 18. This is 180.

Thus applies: lcm(4, 10, 15, 18) = 180

## What can you do with the least common multiple?

The least common multiple can be used to convert 2 fractions so that they have the same denominator afterwards. If you want to add or subtract fractions, it is important that the denominators of both fractions are equal.

If you want to transform 2 fractions so that they have the same denominator afterwards, you can calculate the least common multiple of both denominators and then expand both fractions so that they have the least common multiple as denominator afterwards.

As an example we would like to calculate the following:

3 |

10 |

5 |

16 |

To convert the fractions so that they have the same denominator, you must calculate the lcm of 10 and 16. This amounts to 80. Then expand both fractions so that they have 80 as denominator and then perform the addition:

3 |

10 |

5 |

16 |

24 |

80 |

25 |

80 |

49 |

80 |