Type two to five whole numbers and this calculator finds their HCF (Highest Common Factor) and LCM (Lowest Common Multiple). It draws a factor tree for each number and shows the working by both the prime factorisation method and the division method, just as you write it in your notebook. It is useful for Class 6 and 7 (factors and multiples) and for Class 10 Real Numbers.
What HCF and LCM mean
The HCF (also called GCD, Greatest Common Divisor) of two or more numbers is the biggest number that divides all of them exactly. The LCM is the smallest number that is a multiple of all of them. For 4 and 6, the common factors are 1 and 2, so the HCF is 2. The common multiples are 12, 24, 36 and so on, so the LCM is 12.
Method 1: Prime factorisation (factor tree)
First write each number as a product of primes. A factor tree is an easy way to do this: split the number into two factors, and keep splitting until every branch ends in a prime. By the Fundamental Theorem of Arithmetic, every number greater than 1 has only one prime factorisation (apart from the order of the factors), so whichever way you split, you reach the same primes.
HCF = product of the common prime factors, each taken with its smallest power
LCM = product of all the prime factors, each taken with its greatest power
Method 2: Division method
HCF by long division
Divide the larger number by the smaller one. Then divide the divisor by the remainder. Repeat until the remainder becomes 0. The last divisor is the HCF. In equation form each step is a = b × q + r, which is called Euclid's division algorithm. For three numbers, find the HCF of the first two, then the HCF of that answer and the third number.
LCM by common division
Write the numbers in a row. Divide by a prime that divides at least one of them and write the quotients below. Numbers that are not divisible are brought down as they are. Continue until every number in the row is 1. The LCM is the product of all the divisors on the left.
A useful check for two numbers
HCF × LCM = product of the two numbers. So if you know the HCF, LCM = (first number × second number) ÷ HCF. This rule works only for two numbers, not for three or more.
Worked example
Question: Find the HCF and LCM of 36 and 84 by prime factorisation, and check your answer.
- 36 = 2 × 2 × 3 × 3 = 22 × 32
- 84 = 2 × 2 × 3 × 7 = 22 × 3 × 7
Common primes are 2 and 3. Smallest powers: 22 and 31. So HCF = 22 × 3 = 12.
All primes are 2, 3 and 7. Greatest powers: 22, 32 and 71. So LCM = 22 × 32 × 7 = 4 × 9 × 7 = 252.
By long division: 84 = 36 × 2 + 12, then 36 = 12 × 3 + 0. The remainder is 0, so the HCF is 12, the same answer.
Check: HCF × LCM = 12 × 252 = 3,024 and 36 × 84 = 3,024. Both are equal, so the answer is correct.
Common mistakes
- Taking the greatest power for the HCF and the smallest for the LCM. It is the other way round: HCF uses the smallest power of the common primes, LCM uses the greatest power of every prime.
- Leaving out a prime that appears in only one number when finding the LCM. In the example above, 7 comes only from 84 but it must be in the LCM.
- Stopping a factor tree at a number that is not prime, such as 9 or 21. Keep splitting until every branch ends in a prime.
- Using HCF × LCM = product of the numbers for three numbers. It is true only for two numbers.
- Treating 1 as a prime number. 1 is neither prime nor composite, so it never appears in a prime factorisation.
Practise with
- NCERT Solutions Class 6 Mathematics Chapter 3 Playing with Numbers
- CBSE Class 8 Mathematics Factors and Multiples Notes
- NCERT Solutions Class 10 Mathematics Chapter 1 Real Numbers
- CBSE Class 10 Mathematics Real Numbers Worksheet
The calculator works with whole numbers from 1 up to 1012. Factor trees are drawn for numbers with up to 14 prime factors.