Sub topic 9
Least Common Multiple
This chapter assumes you can factorize a number into primes and can read exponent notation such as 2³ × 3². The previous chapters on prime factorization and HCF cover both. Here you will learn to compute the LCM by three methods, choose the right one, and avoid the usual traps.
What the LCM is
A multiple of n is any number n × k for a positive integer k. The Least Common Multiple (LCM) of two or more numbers is the smallest positive number that every one of them divides exactly.
Take 4 and 6:
- Multiples of 4: 4, 8, 12, 16, 20, 24, ...
- Multiples of 6: 6, 12, 18, 24, ...
- Common multiples: 12, 24, 36, ...
So LCM(4, 6) = 12. Every other common multiple (24, 36, ...) is a multiple of 12. This is the property CAT questions rely on most: every common multiple of a set of numbers is a multiple of their LCM.
Method 1: listing multiples
Write multiples of the largest number and stop at the first one that all the others divide. This works for small numbers, such as LCM(8, 12): test 12 (8 fails), 24 (both divide). It is slow and error-prone once numbers pass two digits, so use it only to check an answer.
Method 2: prime factorization
This is the reliable method. Factorize each number, then take every prime that appears in any number, raised to its highest exponent.
| Number | Factorization |
|---|---|
| 12 | 2² × 3 |
| 18 | 2 × 3² |
| 30 | 2 × 3 × 5 |
| **LCM** | 2² × 3² × 5 = **180** |
The highest power of 2 is 2² (from 12). The highest power of 3 is 3² (from 18). The only 5 comes from 30. Multiplying these gives 4 × 9 × 5 = 180.
Compare this with the HCF rule, which takes only the primes common to all numbers, at their lowest exponent. Mixing up "highest" and "lowest" is the most common slip under time pressure.
Method 3: the division (ladder) method
Write the numbers in a row. Divide by any prime that divides at least two of them. Copy down any number that the prime does not divide. Repeat until no prime divides two or more numbers in the row. The LCM is the product of all the divisors and the remaining row.
For 12, 18, 30:
- Divide by 2: 6, 9, 15.
- Divide by 3: 2, 3, 5.
- No prime divides two of 2, 3, 5.
LCM = 2 × 3 × 2 × 3 × 5 = 180. The ladder is the same calculation as Method 2, written compactly.
Shortcuts worth memorizing
- Coprime numbers (HCF = 1): LCM(a, b) = a × b. For example, LCM(8, 15) = 120.
- One number divides the other: LCM is the larger number. LCM(6, 36) = 36.
- Consecutive numbers are coprime, so LCM(n, n + 1) = n(n + 1).
- Common factor pulled out: LCM(k·a, k·b) = k · LCM(a, b). So LCM(60, 90) = 30 × LCM(2, 3) = 180.
- LCM of 1 to 10 is 2520. It equals 2³ × 3² × 5 × 7, and it reappears in many CAT problems.
Computing it in code
Euclid's algorithm gives the HCF, and the LCM of two numbers is a // gcd × b. For more than two numbers, fold the pairwise LCM across the list.
from math import gcd
from functools import reduce
def lcm(a, b):
return a // gcd(a, b) * b
def lcm_all(numbers):
return reduce(lcm, numbers)
print(lcm_all([12, 18, 30])) # 180
print(lcm_all(range(1, 11))) # 2520Dividing before multiplying (a // gcd(a, b) * b) keeps intermediate values small. In Python 3.9 and later, math.lcm does the same thing directly.
Smallest number with a given remainder
Many CAT questions ask for a number that leaves a stated remainder on division by several divisors. Look at the relationship between each divisor and its remainder.
Same remainder r for every divisor. The number N satisfies N − r = a common multiple of the divisors. The smallest such N is LCM + r.
Smallest number leaving remainder 3 when divided by 8, 12 and 20: LCM(8, 12, 20) = 120, so N = 123.
Remainders differ, but divisor − remainder is constant. Here N + k is a common multiple, where k is the constant gap. The smallest N is LCM − k.
Smallest number leaving remainders 5, 9 and 17 when divided by 8, 12 and 20: the gaps are 8 − 5 = 3, 12 − 9 = 3 and 20 − 17 = 3. So N = 120 − 3 = 117. Checking: 117 = 14 × 8 + 5, 117 = 9 × 12 + 9, and 117 = 5 × 20 + 17.
Largest and smallest numbers of a given size
To find the smallest number with d digits divisible by a set of numbers, take L = LCM and round up to the next multiple of L at or above 10^(d−1). To find the largest, round down below 10^d.
For 12, 18 and 30 (L = 180):
- Smallest 4-digit multiple: 1000 ÷ 180 ≈ 5.56, so use 6 × 180 = 1080.
- Largest 4-digit multiple: 9999 ÷ 180 ≈ 55.55, so use 55 × 180 = 9900.
To count the multiples of L up to some limit, use floor(limit / L). There are 55 multiples of 180 up to 9999.
Common traps
Product instead of LCM. LCM(4, 6) is 12, not 24. Multiplying numbers gives a common multiple, but it is the least one only when the numbers are coprime.
The three-number formula. For two numbers, HCF × LCM = a × b. This does not extend to three numbers. For 6, 10 and 15, the HCF is 1 and the product is 900, but the LCM is 30, not 900. For three or more numbers, use prime factorization or the ladder.
Pairwise coprime versus overall HCF. The numbers 6, 10 and 15 have overall HCF 1, yet no two of them are coprime. The shortcut "coprime means multiply" requires every pair to be coprime.
Choosing LCM when the question needs HCF. Use LCM when events repeat on a schedule and you want when they coincide (bells, traffic lights, runners on a track). Use HCF when you split or cut into the largest equal pieces. Word problems are covered in a later chapter, but the rule of thumb starts here: "together again" means LCM.
Off-by-one in remainder problems. Whether the answer is LCM + r or LCM − k depends on the pattern. Always verify by dividing your answer by one of the original divisors.
Worked example: bells
Three bells ring at intervals of 12, 18 and 30 minutes. They ring together at 9:00 a.m. When do they next ring together?
They coincide after LCM(12, 18, 30) = 180 minutes, which is 3 hours. The next time is 12:00 noon. They then coincide again at 3:00 p.m., and so on at every multiple of 180 minutes.
Exercise
Find the smallest number that leaves a remainder of 4 when divided by 6, 9 and 15, and is also a multiple of 7.
Show answer
The remainders are equal, so N − 4 must be a multiple of LCM(6, 9, 15) = 90. Write N = 90k + 4 and require N divisible by 7. Since 90 ≡ 6 (mod 7), we need 6k + 4 ≡ 0 (mod 7), so 6k ≡ 3 (mod 7). Multiplying by 6 (the inverse of 6 mod 7) gives k ≡ 18 ≡ 4 (mod 7). The smallest k is 4, so N = 90 × 4 + 4 = 364. Check: 364 = 7 × 52, and 364 − 4 = 360 = 4 × 90.
Exercise
The HCF of two numbers is 12 and their LCM is 360. If one number is 72, what is the other, and why can't you use the same formula for three numbers?
Show answer
Use HCF × LCM = product of the two numbers. 12 × 360 = 4320, and 4320 ÷ 72 = 60. The other number is 60. The formula holds only for two numbers because with three or more, a prime's lowest and highest exponents do not pair up across all numbers. For 6, 10 and 15 the product is 900, but HCF × LCM = 1 × 30 = 30.