How this calculation works
The greatest common divisor is the largest positive integer that divides every entered number. The least common multiple is the smallest positive shared multiple for nonzero inputs. Use the GCD to simplify integer proportions and the LCM to align repeating cycles with whole-number periods.
Worked example
This example uses illustrative inputs. Your current result is shown above.
For 12, 18 and 24, gcd(12,18) = 6 and gcd(6,24) = 6. lcm(12,18) = 36, then lcm(36,24) = 72. The outputs are GCD 6 and LCM 72.
Assumptions and limits
- Use whole numbers within the safe input range; fractional measurements need an explicitly chosen common unit first.
- Negative signs are ignored when finding positive divisors and multiples.
- If some but not all inputs are zero, the LCM is zero by this tool’s convention. An all-zero list is rejected.
Questions people ask
Can I enter more than two numbers?
Yes. Each result is accumulated over the complete list, so the final GCD divides every input and the final LCM is shared by all nonzero inputs.
Why does including zero change the LCM?
This implementation uses lcm(a,0) = 0. For scheduling recurring events, use positive nonzero periods rather than treating a nonrecurring event as a zero-length cycle.