Sub topic 11
HCF x LCM = product of two numbers
This chapter assumes you can find the HCF and LCM by prime factorization, and that you are comfortable with exponents and basic algebra. It covers a shortcut that CAT uses constantly: for two numbers, HCF × LCM = their product. The chapter derives the relation, uses it, and marks where it stops working.
The relation
For two positive integers a and b:
HCF(a, b) × LCM(a, b) = a × b
Take 12 and 18. The HCF is 6 and the LCM is 36. Then 6 × 36 = 216 and 12 × 18 = 216.
Why it holds
Write both numbers over the same primes, allowing exponent 0. For 12 and 18:
| Prime | 12 | 18 | HCF takes (min) | LCM takes (max) | min + max |
|---|---|---|---|---|---|
| 2 | 2^2 | 2^1 | 2^1 | 2^2 | 3 |
| 3 | 3^1 | 3^2 | 3^1 | 3^2 | 3 |
For each prime, the HCF uses the smaller exponent and the LCM uses the larger one. The two exponents together are the same two exponents that a and b have, only swapped between the numbers. So min + max always equals the sum of the exponents in a and b. Multiplying numbers adds exponents, so HCF × LCM has the same exponent for every prime as a × b.
The coprime shortcut
If a and b are coprime, their HCF is 1. Then LCM = a × b. For 8 and 15, the LCM is 120. This is the fastest way to get the LCM of two coprime numbers, and it is the case CAT uses most often.
Standard uses
Find the missing number
Given HCF, LCM and one number, the other number is (HCF × LCM) / known number.
Example: the HCF of two numbers is 21, their LCM is 1260, and one number is 105. The other number is 21 × 1260 / 105 = 252.
Find the LCM from the HCF and the product
Example: two numbers have product 2400 and HCF 20. Then LCM = 2400 / 20 = 120.
Use the form hx and hy
If the HCF of a and b is h, you can write a = hx and b = hy, where x and y are coprime. Then:
- LCM = hxy
- a × b = h²xy, which equals HCF × LCM = h × hxy
Example: two numbers are in the ratio 3 : 5 and their LCM is 300. Write them as 3h and 5h. Since 3 and 5 are coprime, the HCF is h and the LCM is 15h. So 15h = 300, h = 20, and the numbers are 60 and 100.
Always write ratio problems this way. Treating the ratio terms 3 and 5 as the numbers is a common mistake.
Count the pairs with a given HCF and LCM
Suppose HCF = h and LCM = L. Two facts follow:
- h must divide L. If it does not, no pair exists.
- Write L / h = xy with x and y coprime. The pair is (hx, hy).
Each distinct prime in L / h must go entirely into x or entirely into y. If L / h has k distinct primes, there are 2^k ordered pairs. Count unordered pairs by halving, which gives 2^(k−1) when L / h > 1.
Example: HCF 12 and LCM 360. L / h = 30 = 2 × 3 × 5, so k = 3. There are 2^3 = 8 ordered pairs, or 4 unordered pairs: (12, 360), (24, 180), (36, 120), (60, 72).
The next program checks this by brute force.
from math import gcd
def pairs_with_hcf_lcm(h, lcm):
"""Unordered pairs (a, b), a <= b, with HCF h and LCM lcm."""
if lcm % h != 0:
return []
product = h * lcm
result = []
for a in range(h, lcm + 1, h):
if product % a != 0:
continue
b = product // a
if a <= b and gcd(a, b) == h:
result.append((a, b))
return result
# Verify the relation itself on a few pairs
for a, b in [(12, 18), (252, 105), (8, 15)]:
h = gcd(a, b)
l = a * b // h
print(a, b, h, l, h * l == a * b)
print(pairs_with_hcf_lcm(12, 360))
# [(12, 360), (24, 180), (36, 120), (60, 72)]The test gcd(a, b) == h is enough. If the HCF is h, the LCM is a × b / h, which equals L because b was chosen as h × L / a.
Limits of the relation
It fails for three or more numbers
For three numbers, HCF × LCM is generally not the product.
Take 4, 6 and 9. The HCF is 1 and the LCM is 36. Their product is 216, but HCF × LCM = 36.
A related fact does hold for three numbers, but it is rarely tested and needs the pairwise HCFs. Treat the relation as a two-number tool only.
The HCF always divides the LCM
Both the HCF and every number divide the LCM, and the HCF divides every number. So the chain is HCF ≤ each number ≤ LCM, with HCF dividing LCM. This gives quick feasibility checks:
- A problem that states HCF 8 and LCM 60 is impossible, because 8 does not divide 60.
- If a problem states HCF 15 and LCM 45, neither number can be below 15 or above 45, and both must be multiples of 15 that divide 45. The only pairs are (15, 45) and (45, 45)... but (45, 45) has HCF 45, so the only pair is (15, 45).
Equal numbers and one dividing the other
- If a = b, then HCF = LCM = a.
- If a divides b, then HCF = a and LCM = b. The product relation still holds: a × b.
The relation does not give you the numbers
HCF and LCM together fix the product, but many pairs can share the same pair of values, as the 12 and 360 example shows. A question asking for "the numbers" needs an extra condition, such as the sum, the difference or the ratio.
Example: the HCF is 20, the LCM is 120, and the sum of the numbers is 160. The product is 2400, so with a = 20x and b = 20y we need xy = 6 and x + y = 8. The coprime pairs with xy = 6 are (1, 6) and (2, 3), with sums 7 and 5. Neither sum is 8, so no such pair exists. Check the stated data before solving.
Common traps
- Using the relation for three numbers. It does not hold.
- Forgetting that the numbers are multiples of the HCF. In sum or ratio problems, always set a = hx and b = hy.
- Not checking that h divides L. If it does not, the question has no answer, and the option "cannot be determined" may be correct.
- Counting ordered pairs when the question asks for unordered ones. Read whether (24, 180) and (180, 24) are the same pair.
- Skipping the coprime check on x and y. If x and y share a factor, then h × x and h × y have a larger HCF than h.
- Calculating a × b first. For large numbers, divide first: LCM = a / HCF × b. This keeps the numbers small, as in the
lcmfunction you saw earlier.
Exercises
Exercise
The HCF of two numbers is 16 and their LCM is 480. One number is 96. Find the other number.
Show answer
The product is 16 × 480 = 7680. The other number is 7680 / 96 = 80. Check: HCF(96, 80) = 16 and LCM(96, 80) = 480.
Exercise
Two numbers have HCF 9 and LCM 540. How many ordered pairs (a, b) of such numbers exist, and how many unordered pairs?
Show answer
L / h = 540 / 9 = 60 = 2^2 × 3 × 5, which has k = 3 distinct primes. The number of ordered pairs is 2^3 = 8, and the number of unordered pairs is 4. Note that 2^2 must stay together in x or y.
Exercise
Two numbers are in the ratio 4 : 7 and their HCF is 15. Find their LCM and the product of the numbers.
Show answer
The numbers are 60 and 105. Since 4 and 7 are coprime, LCM = 15 × 4 × 7 = 420. The product is 60 × 105 = 6300, which equals HCF × LCM = 15 × 420.
Exercise
For the numbers 6, 10 and 15, compute HCF × LCM and the product of the numbers. Do they match?
Show answer
The HCF is 1 and the LCM is 30, so HCF × LCM = 30. The product is 6 × 10 × 15 = 900. They do not match, because the relation holds only for two numbers.