Euclidean Algorithm: HCF Formula, Method and Examples

Euclidean Algorithm finds the HCF of two positive integers through repeated division. It replaces the larger number with the remainder after division until the remainder becomes zero. The last non-zero remainder is the HCF. This page explains the formula, division steps, useful shortcuts, properties and numerical examples used in quantitative aptitude.

On this page

What is the Euclidean Algorithm?

The Euclidean Algorithm is a repeated-division method for finding the HCF, or greatest common divisor, of two integers. At every step, the larger number is divided by the smaller number, and the divisor and remainder form the next pair.

For positive integers a and b, where a ≥ b, the basic rule is HCF(a, b) = HCF(b, a mod b). Continue the process until the remainder is 0. The divisor in the final division is the HCF. For example, 252 = 105 × 2 + 42, 105 = 42 × 2 + 21, and 42 = 21 × 2 + 0. Therefore, HCF(252, 105) = 21.

Euclidean Algorithm Formula & Tricks

Important Formulas

Euclidean Algorithm Formula
HCF(a, b) = HCF(b, a mod b), where a ≥ b > 0

The HCF does not change when the larger number is replaced by the remainder obtained on division by the smaller number.

Division Form
a = bq + r, where 0 ≤ r < b

Here, a is the dividend, b is the divisor, q is the quotient and r is the remainder.

Final HCF Rule
If a = bq + 0, then HCF(a, b) = b

When the remainder becomes zero, the divisor of that final division is the HCF.

Quick Tricks

Stop at the first zero remainder

Do not continue after a zero remainder. The divisor in that line is the HCF.

Example: For 462 = 147 × 3 + 21 and 147 = 21 × 7 + 0, the HCF is 21.
Use the difference shortcut

The property HCF(a, b) = HCF(a − b, b) can reduce calculations when the numbers are close. Repeat subtraction or combine it with division.

Example: HCF(91, 65) = HCF(26, 65) = HCF(65, 26). The usual division then gives 65 = 26 × 2 + 13, so the HCF is 13.
Remove common factors first

If both numbers have an obvious common factor, divide it out, find the HCF of the reduced numbers, and multiply the result by that factor.

Example: HCF(84, 126) = 6 × HCF(14, 21) = 6 × 7 = 42.

Euclidean Algorithm Concepts

Division Steps in the Euclidean Method

Divide the larger number by the smaller number and replace the pair with the smaller number and the remainder.

Write each step in the form dividend = divisor × quotient + remainder. Continue while the remainder is non-zero. The last non-zero remainder gives the HCF.

Example: For 1071 and 462: 1071 = 462 × 2 + 147; 462 = 147 × 3 + 21; 147 = 21 × 7 + 0. Hence, HCF(1071, 462) = 21.

Why the Remainder Rule Works

A common divisor of a and b also divides the remainder a − bq, so replacing a with the remainder preserves the common divisors.

If a = bq + r, then r = a − bq. Every common divisor of a and b divides r, and every common divisor of b and r divides a. Therefore, HCF(a, b) = HCF(b, r).

Example: Since 252 = 105 × 2 + 42, the common divisors of 252 and 105 are exactly the common divisors of 105 and 42.

Difference Property of HCF

For positive integers a and b, HCF(a, b) = HCF(a − b, b) when a > b.

Subtracting the smaller number from the larger one preserves the set of common divisors. Repeated subtraction is equivalent to repeated division, but division is usually faster for large numbers.

Example: HCF(48, 18) = HCF(30, 18) = HCF(12, 18) = HCF(6, 12) = 6.

Handling More Than Two Numbers

Find the HCF of two numbers first, then find the HCF of that result with the next number.

For three numbers, HCF(a, b, c) = HCF(HCF(a, b), c). This process can be continued for any number of integers.

Example: HCF(24, 36, 60) = HCF(HCF(24, 36), 60) = HCF(12, 60) = 12.

Co-Prime Numbers and Termination

Two numbers are co-prime when their HCF is 1, and the Euclidean process ends with a final non-zero remainder of 1.

If the final non-zero remainder is 1, the numbers have no common factor greater than 1. If one number divides the other exactly, the smaller number is the HCF after the first division.

Example: For 35 and 64: 64 = 35 + 29, 35 = 29 + 6, 29 = 6 × 4 + 5, 6 = 5 + 1. Therefore, HCF(35, 64) = 1.

Euclidean Algorithm Video Lessons

Watch short topic-wise lessons for quick revision.

14 Lessons
Lesson 1 of 14 Quick Revision

HCF Using Prime Factorisation and Euclidean Algorithm

Learn to calculate the Highest Common Factor using prime factorisation and the Euclidean algorithm, with a clear understanding of how both methods work.

Continue with more lessons and practice in PrepShots.Watch More in App - Start ₹1 Trial →
More Euclidean Algorithm Lessons Scroll to explore →

Practice Euclidean Algorithm Questions

Practise published questions related to this topic.

Euclidean Algorithm Quick Quiz

Attempt 5 questions and check your score instantly.

Quick Revision Notes

Euclidean Algorithm Quick Revision

Use repeated division to reduce the pair of numbers until the remainder becomes zero.

  • For a ≥ b > 0, use HCF(a, b) = HCF(b, a mod b).
  • Write every division as a = bq + r, with 0 ≤ r < b.
  • The divisor in the final division with zero remainder is the HCF.
  • The difference property is HCF(a, b) = HCF(a − b, b) when a > b.
  • For multiple numbers, apply the algorithm successively: HCF(a, b, c) = HCF(HCF(a, b), c).
  • A final non-zero remainder of 1 means the numbers are co-prime.
  • If b divides a exactly, HCF(a, b) = b.

Euclidean Algorithm FAQs

What is the Euclidean Algorithm formula for HCF?

The formula is HCF(a, b) = HCF(b, a mod b), where a ≥ b > 0. Repeat this replacement until the remainder is zero.

How is HCF(252, 105) found using the division method?

252 = 105 × 2 + 42, 105 = 42 × 2 + 21, and 42 = 21 × 2 + 0. Therefore, HCF(252, 105) = 21.

What is the HCF when one number divides the other exactly?

The smaller number is the HCF. For example, since 72 = 24 × 3, HCF(72, 24) = 24.

Can the Euclidean Algorithm be used for three numbers?

Yes. Find the HCF of two numbers and then use that result with the third: HCF(a, b, c) = HCF(HCF(a, b), c).

What does a final non-zero remainder of 1 indicate?

It indicates that the two numbers are co-prime, so their HCF is 1. For example, HCF(35, 64) = 1.

What is the difference between the Euclidean Algorithm and the HCF division method?

They are the same repeated-division procedure. In both methods, the last non-zero remainder is the HCF.

Continue learning Euclidean Algorithm on PrepShots

Continue on PrepShots