How to use it
- Enter two or more whole numbers.
- Read the GCD (also called HCF) and the LCM.
- Check the prime factors of the first ten numbers.
How it works
The GCD uses Euclid’s algorithm, which repeatedly replaces the pair (a, b) by (b, a mod b) until the remainder is zero. The LCM of two numbers is a ÷ GCD × b, applied across the list. Arithmetic is exact (BigInt). Prime factors are found by trial division up to the square root.
Examples
- 12, 18 and 24 have GCD 6 and LCM 72. 360 = 2³ × 3² × 5.
Limitations
- Numbers up to 18 digits; prime factors only for numbers up to 10^12 (about a trillion).
- Zero is rejected because the LCM with zero is not defined. Signs are ignored.
Last verified . See our Accuracy & Editorial Policy. Found a problem? Email contact@tools.gift.