HCF and LCM from prime factors · Mathematics Class 9–10 | StemPy Lab
Course 2.1·Lesson 2 of 3
HCF and LCM from prime factors
The HCF of two or more numbers takes each common prime with its smallest power. The LCM takes every prime with its greatest power. For two numbers, HCF times LCM equals the product of the numbers. This rule does not hold for three numbers.
about 30 min1 simulation2 practice questions1 Python program5 questions to check yourself
This lesson is free to read. Enroll free to keep your place and take the tests.
Lesson 2 of 3Show all lessonsHide
Try the code and the simulations beside the lesson.
Two words to recall
The HCF (highest common factor) of some numbers is the largest number that divides each of them.
The LCM (lowest common multiple) is the smallest number that each of them divides.
For small numbers you can list factors and multiples. For larger numbers that is slow, and it is easy to miss one. The prime factorisation gives both at once.
The HCF and the LCM from the primes
Write each number as a product of prime powers.
HCF: take the primes that are in every number, each with its smallest power.
LCM: take every prime that appears, each with its greatest power.
A worked example. Find the HCF and the LCM of 84 and 120.
Factorise.84=22×3×7 and 120=23×3×5.
HCF. The common primes are 2 and 3. Smallest powers: 22 and 31. HCF =4×3=12.
LCM. All the primes: 2,3,5,7. Greatest powers: 23,31,51,71. LCM =8×3×5×7=840.
Two overlapping circles. The left circle is 84 = 2² × 3 × 7, the right circle is 120 = 2³ × 3 × 5. The overlap holds 2, 2 and 3, the primes in both. The left part alone holds 7, the right part alone holds 2 and 5. In both: 2 × 2 × 3 = 12, the HCF. All of them: 2 × 2 × 2 × 3 × 5 × 7 = 840, the LCM.
The picture shows why. The overlap holds the primes that both numbers share: that is the HCF. Everything in the two circles together is the LCM.
Three numbers
The rule works for any number of numbers. Take 12=22×3, 18=2×32 and 30=2×3×5.
HCF: 2 and 3 are in all three, with smallest powers 21 and 31. HCF =6.
LCM: greatest powers 22,32,51. LCM =4×9×5=180.
A rule for two numbers
For 84 and 120: HCF × LCM =12×840=10080, and 84×120=10080. The same!
For two numbers a and b, this is always true:
HCF(a,b)×LCM(a,b)=a×b
The reason is in the powers. For each prime, the HCF takes the smaller power and the LCM the greater one. Together they use both powers, exactly as the product a×b does.
Careful: only for two numbers. For 4, 6 and 10, the HCF is 2 and the LCM is 60. So HCF × LCM =120, but 4×6×10=240.
The rule has two uses. It finds the LCM quickly when you know the HCF. It also checks your answers.
Two facts follow. The HCF always divides the LCM. And if two numbers have no common prime, their HCF is 1 and their LCM is their product. Such numbers are called co-prime.
Practise with new numbers
Try it in Python
The program factorises both numbers, then builds the HCF from the smaller powers and the LCM from the greater ones.
Common mistakes
Swapping the powers. The HCF takes the smallest power, the LCM the greatest. A quick check: the HCF can never be larger than the smallest number.
Leaving out a prime from the LCM. A prime that is in only one number still goes into the LCM. Only the HCF needs the prime in every number.
Using the product rule for three numbers. HCF × LCM = product holds for two numbers only.
Multiplying the numbers to get the LCM.6×8=48 is a common multiple of 6 and 8, but the LCM is 24.
Remember these
HCF: common primes, smallest powers. LCM: all primes, greatest powers.
For two numbers, HCF × LCM =a×b. Not for three.
The HCF divides the LCM. Co-prime numbers have HCF 1.
Check yourself
Try each one on your own first. If you are stuck, open a hint. Then check with Show the answer.
Find the HCF and the LCM of 24×3 and 22×32×5.
What are the HCF and the LCM of the primes 17 and 23?
Two numbers have an HCF of 9 and an LCM of 270. One of them is 54. Find the other.
Why can the LCM of two numbers never be smaller than either of them?
Is it true that HCF × LCM =2×3×4 for the numbers 2, 3 and 4?
Enroll free in Primes, HCF and LCM
Every lesson is open to read. Enrolling also lets you:
Mark lessons done and carry on where you stopped.
Take the tests of this lesson and its course.
Count the course towards the certificate for its chapter.