Least Common Multiple Calculator
Find the LCM of any list of positive integers.
Table of Contents
How to Use
- Enter at least two integers separated by spaces, commas, or semicolons.
- Submit the list to normalize the numbers and run the gcd-based LCM steps.
- Review the gcd result for each pair and the running LCM.
- Use the final LCM for simplifying fractions or aligning repeating cycles.
What is the least common multiple?
The least common multiple (LCM) of a set of integers is the smallest positive number that each integer divides evenly. It is useful for combining fractions, synchronizing repeating events, and working with modular arithmetic.
LCM is closely related to the greatest common divisor (gcd). The product of two numbers equals the product of their gcd and LCM: a × b = gcd(a, b) × lcm(a, b).
How this calculator finds the LCM
- Normalize the list by removing empty entries and converting to integers.
- Apply the gcd to the current LCM and the next number in the list.
- Update the running LCM using lcm(a, b) = |a × b| / gcd(a, b).
- Repeat until every number has been processed.
The step-by-step view shows each gcd call so you can verify how the final LCM was built.
Frequently Asked Questions
- Do I need to sort the numbers first?
- No. The algorithm processes numbers in the order you provide and updates a running LCM. Sorting does not change the final result.
- Can I mix negative values?
- The calculator expects positive integers. Negative values or zero would break the definition of LCM and are rejected during validation.
- How is this different from the gcd?
- The gcd finds the largest shared factor while the LCM finds the smallest shared multiple. They are connected by the identity a × b = gcd(a, b) × lcm(a, b).