Find the Least Common Multiple (LCM) of two or more integers using prime factorization. Also shows GCF and step-by-step prime factor method.
| Number | 2 | 3 | 5 | Factors |
|---|---|---|---|---|
| 4 | 2^2 | — | — | 2^2 |
| 6 | 2 | 3 | — | 2 × 3 |
| 10 | 2 | — | 5 | 2 × 5 |
| LCM (max) | 2^2 | 3 | 5 | 2^2 × 3 × 5 |
For multiple numbers, LCM is computed iteratively.
| Step | Calculation | Result |
|---|---|---|
| 1 | LCM(4, 6) | 12 |
| 2 | LCM(12, 10) | 60 |
| Property | Formula |
|---|---|
| LCM from GCF | LCM(a,b) = a×b / GCF(a,b) |
| Prime factorization | Take highest power of each prime |
| Relationship | GCF × LCM = a × b |
| LCM ≥ max(nums) | Always true |
| If GCF = 1 | LCM = a × b |
| Numbers | LCM | Use case |
|---|---|---|
| 2, 3 | 6 | Adding ½, ⅓, ⅙ |
| 4, 6 | 12 | Adding ¼, ⅙ |
| 3, 4 | 12 | Adding ⅓, ¼ |
| 6, 10 | 30 | Adding ⅙, 1/10 |
| 5, 7 | 35 | Adding ⅕, 1/7 |
You have three LED strips that blink every 4, 6 and 10 seconds, and you need to know how long until all three flash together. The answer is the least common multiple, 60 seconds, and you can type the three numbers as a list instead of working it out on paper. The page also returns the greatest common factor, a prime-factor grid and a step-by-step chain so you can check the arithmetic.
For two numbers, LCM(a, b) = a ÷ GCF(a, b) × b, with GCF found by Euclid's remainder method. For a longer list the page folds left to right: LCM(a, b, c) = LCM(LCM(a, b), c). A second route gives the same answer: write each number as prime powers and keep the highest power of every prime that appears.
Worked example: 4, 6, 10. In primes, 4 = 2², 6 = 2 × 3 and 10 = 2 × 5. Highest powers are 2², 3 and 5, so the LCM is 4 × 3 × 5 = 60. The chain agrees: LCM(4, 6) = 12, then LCM(12, 10) = 60. The GCF of all three is 2. The textbook relation GCF × LCM = a × b is true for two numbers (4 and 6: 2 × 12 = 24) but not for three: 2 × 60 = 120, while 4 × 6 × 10 = 240.
Limits. The page reads only positive whole numbers. Any other entry in the list, whether a decimal, a zero, a negative or a stray word, is silently dropped, so 4, 6.5, 10 is treated as 4, 10 with an LCM of 20. Every number must be 1,000,000,000 or less, and at least two valid numbers are needed. The LCM itself is a standard JavaScript number, exact only up to 9,007,199,254,740,991. For 999999937 and 999999929, which share no factor, the true LCM is 999999866000004473, but the page shows 999,999,866,000,004,500.
When they share no prime factor, meaning their GCF is 1. For 5 and 7 it is 35. For 6 and 10, which share a 2, it is 30 instead of 60.
A 1 never changes the LCM, and repeats make no difference either, so 6, 6 gives 6. Repeated numbers still appear as rows in the factor table.
Enter the denominators. For 1/2 + 1/3 + 1/6 the LCM of 2, 3, 6 is 6, so the sum is 3/6 + 2/6 + 1/6 = 1.
Type 1, 2, 3 and so on up to 20. The LCM is 232,792,560. The same trick for 1 to 10 gives 2,520.