Euclid's Division Algorithm (original) (raw)

Last Updated : 10 Jul, 2025

The **Euclidean Division Algorithm is a method used in mathematics to find the greatest common divisor (GCD) of two integers. It is based on Euclid's Division Lemma. In this algorithm, we repeatedly divide and find remainders until the remainder becomes zero. This process is fundamental in number theory and helps in simplifying problems involving divisors and multiples.

According to the **Euclidean Division Algorithm, two positive integers a and b, where a = bq + r, a common divisor of a and b is also a common divisor of b and r, and vice versa, **GCD(a, b) = GCD(b, r).

Steps to find the **GCD(A, B) using the Euclidean Division Algorithm:

Proof Of Euclidean Division Algorithm

**To Prove: For a = bq + r, any common divisor of a and b is also a common divisor of b and r, and vice versa.

**Proof: Let c be a common divisor of a and b. This means:

  1. **c divides **a, so a = cq1 ​ for some integer q1​.
  2. **c divides b, so b = cq2​ for some integer q2​.

Now, using the relation a = bq + r, we can write: **r = a − bq.

Substitute a = cq1 and b = cq2: **r = cq 1 **− cq 2 q.

Factor out c: **r = c(q 1 − q 2 q)...............(i)

This shows that c∣r. Hence, c divides both b and r, meaning c is a common divisor of b and r.

Thus, any common divisor of a and b is also a common divisor of b and r.

Now, let d be a common divisor of b and r. This means:

Using the relation a = bq + r , substitute b = r1d and r = r2d: **a = r 1 dq + r 2 d.

Factor out d: **a = d(r 1 q + r 2 )...............(ii)

This shows that d divides a. Thus, d divides both a and b, meaning d is a common divisor of a and b.

From the two parts above (i) and (ii), we conclude that:

GCD(a, b) = GCD(b, r)

The Euclidean Algorithm repeatedly applies the division a = bq + r by replacing (a, b) with (b, r). At each step, the remainder r strictly decreases because 0 ≤ r < b0.

Since r is a non-negative integer, the sequence of remainders: a, b, r1, r2, … , a > b > r1 > r2 > …, must eventually reach r = 0 after a finite number of steps.

When the algorithm terminates(r = 0), the last non-zero value of **b is the greatest common divisor (GCD) of the original integers a and b.

Thus, the Euclidean Division Algorithm is both valid and guaranteed to terminate in a finite number of steps, providing the greatest common divisor (GCD) of the original integers a and b.

GCD of Two Numbers Using **Euclid’s Division Algorithm

The GCD of two numbers can be found by using the Euclidean division algorithm as shown in the steps below.

Given two integers a (dividend) and b (divisor), where **a ≥ b > 0,

**Step 1: Divide **a by **b to get a quotient q and a remainder **r:

**a = b ⋅ q + r where **0 ≤ r < b.

**Step 2: Replace **a with b and **b with r.

**Step 3: Repeat the process until r = 0.

**Step 4: When you get a remainder of zero, the last non-zero remainder you found is the greatest common divisor (GCD) of the original two numbers as GCD( 0, A ) = GCD( A, 0 ) = A

**Example 1: Find the GCD of 252 and 105

**Solution:

**Divide 252 by 105:
252 = 105 × 2 + 42 ( Quotient = 2, Remainder = 42)

**Replace a with 105 and b with 42, then divide again, since GCD(252, 105) = GCD(105, 42):
105 = 42 × 2 + 21 ( Quotient = 2, Remainder = 21)

**Replace a with 42 and b with 21, then divide again, since GCD(105, 42) = GCD(42, 21):
42 = 21 × 2 + 0 ( Quotient = 2, Remainder = 0)

**Stop here because the remainder is now 0 and GCD(42, 21) = GCD(21, 0).
And GCD(21, 0) = 21

then, **GCD(252, 105) = GCD(105, 42) = GCD(42, 21) = GCD(21, 0) = 21
**GCD(252, 105) = 21.

Example 2: Find the GCD of 360 and 96

**Solution:

**Divide 360 by 96:
360 = 96 × 3 + 72 (Quotient = 3, Remainder = 72)

**Replace a with 96 and b with 72, then divide again, since GCD(360, 96) = GCD(96, 72):
96 = 72 × 1 + 24 (Quotient = 1, Remainder = 24)

**Replace a with 72 and b with 24, then divide again, since GCD(96, 72) = GCD(72, 24):
72 = 24 × 3 + 0 (Quotient = 3, Remainder = 0)

**Stop here because the remainder is now 0 and GCD(72, 24) = GCD(24, 0).
And GCD(24, 0) = 24
then, **GCD(360, 96) = GCD(96, 72) = GCD(72, 24) = GCD(24, 0) = 24

**GCD(360, 96) = 24

Practice Problem Based on Euclid's Division Algorithm

**Question 1. Find the GCD of 120 and 45 using the Euclidean Division Algorithm.
**Question 2. Find the GCD of 144 and 60 using the Euclidean Division Algorithm.
**Question 3. Find the GCD of 462 and 192 using the Euclidean Division Algorithm.
**Question 4. Find the GCD of 84 and 56 using the Euclidean Division Algorithm.

**Answer:-

  1. **GCD of 120 and 45 = 15
  2. **GCD of 144 and 60 = 12
  3. **GCD of 462 and 192 = 6
  4. **GCD of 84 and 56 = 28

Also Check: