2 | 4 | 6 | 9 | 15 |
3 | 2 | 3 | 9 | 15 |
2 | 1 | 3 | 5 |
LCM = 2 x 3 x 2 x 1 x 3 x 5 = 180
Find the smallest number which can divide at least 2 input numbers.
Candidate dividers are: (2, 3, 5, 7)
Let's try with 2 | |
---|---|
Is 4 divisible by 2 | Yes |
Is 6 divisible by 2 | Yes |
Is 9 divisible by 2 | No |
Is 15 divisible by 2 | No |
2 numbers {4, 6} are divisable by 2.Therefore 2 is our divisor.
Divide the input numbers which are divisible by our selected divisor 2.
2 | 4 | 6 | 9 | 15 |
2 | 3 | 9 | 15 |
Find the smallest number which can divide at least 2 input numbers.
Candidate dividers are: (2, 3, 5, 7)
Let's try with 2 | |
---|---|
Is 2 divisible by 2 | Yes |
Is 3 divisible by 2 | No |
Is 9 divisible by 2 | No |
Is 15 divisible by 2 | No |
Only one numbers {2} is divisable by 2.Therefore 2 is not our divisor.
Let's try with 3 | |
---|---|
Is 2 divisible by 3 | No |
Is 3 divisible by 3 | Yes |
Is 9 divisible by 3 | Yes |
Is 15 divisible by 3 | Yes |
3 numbers {3, 9, 15} are divisable by 3.Therefore 3 is our divisor.
Divide the input numbers which are divisible by our selected divisor 3.
2 | 4 | 6 | 9 | 15 |
3 | 2 | 3 | 9 | 15 |
2 | 1 | 3 | 5 |
Find the smallest number which can divide at least 2 input numbers.
Candidate dividers are: (2, 3)
Let's try with 2 | |
---|---|
Is 2 divisible by 2 | Yes |
Is 1 divisible by 2 | No |
Is 3 divisible by 2 | No |
Is 5 divisible by 2 | No |
Only one numbers {2} is divisable by 2.Therefore 2 is not our divisor.
Let's try with 3 | |
---|---|
Is 2 divisible by 3 | No |
Is 1 divisible by 3 | No |
Is 3 divisible by 3 | Yes |
Is 5 divisible by 3 | No |
Only one numbers {3} is divisable by 3.Therefore 3 is not our divisor.
No divisor found. We should calculate LCM Now.
2 | 4 | 6 | 9 | 15 |
3 | 2 | 3 | 9 | 15 |
2 | 1 | 3 | 5 |
Multiply divisors (2, 3) and remaining numbers (2, 1, 3, 5) to get the lcm.
LCM = 2 x 3 x 2 x 1 x 3 x 5 = 180