Euclid’s Division Lemma

Euclid's Division Lemma is one of the oldest and most fundamental results in number theory, named after the ancient Greek mathematician Euclid who presented it in his celebrated work Elements around 300 BCE. The lemma states that for any two positive integers a and b, there exist unique integers q and r such that a = bq + r, where 0 ≤ r < b. In plain language, when you divide any integer by a positive integer, you always get a quotient and a remainder, and that remainder is strictly less than the divisor. This seemingly simple statement is the cornerstone of a powerful algorithm for finding the Highest Common Factor (HCF) — also called the Greatest Common Divisor (GCD) — of two numbers. The real power of Euclid's Division Lemma lies in its repeated application. By applying the lemma over and over, reducing the problem at each step, we can systematically find the HCF of any two positive integers without ever needing to factorize them. This process is called the Euclidean Algorithm and is one of the oldest known algorithms in mathematics — predating modern computers by more than two millennia. It remains widely used today in computer science, cryptography, and algebra because of its efficiency and elegance. Understanding Euclid's Division Lemma also deepens your appreciation of how numbers are structured. It forms the basis for understanding divisibility, prime factorization, and modular arithmetic. In higher mathematics, it generalizes to other algebraic structures called Euclidean domains. For high school students, mastering this concept builds essential skills for solving HCF problems, proving divisibility results, and forming a rigorous foundation in number theory.

Key takeaways
  • State the Lemma Precisely
  • Apply the Lemma to Find HCF
  • Why the Algorithm Must Terminate
  • Key Property: HCF is Preserved
  • Expressing HCF as a Linear Combination (Extended Euclidean Algorithm)

State the Lemma Precisely

For any two positive integers a and b (with a ≥ b), there exist unique integers q (quotient) and r (remainder) such that a = bq + r, where 0 ≤ r < b. The uniqueness part guarantees there is only one such pair (q, r) for any given a and b — this is what makes the algorithm reliable and predictable.

Apply the Lemma to Find HCF

To find HCF(a, b), apply the lemma: write a = bq₁ + r₁. If r₁ = 0, then HCF(a, b) = b. If r₁ ≠ 0, replace a with b and b with r₁, then repeat: b = r₁q₂ + r₂. Continue this process, always replacing the previous divisor with the new remainder, until the remainder becomes 0. The last non-zero remainder is the HCF.

Why the Algorithm Must Terminate

Each step produces a remainder strictly smaller than the previous remainder: a > b > r₁ > r₂ > r₃ > … ≥ 0. Since the remainders form a strictly decreasing sequence of non-negative integers, the sequence must eventually reach 0. This guarantees the algorithm always finishes in a finite number of steps — at most b steps, but usually far fewer.

Key Property: HCF is Preserved

The mathematical justification rests on the fact that HCF(a, b) = HCF(b, r) whenever a = bq + r. This is because any common divisor of a and b must also divide r = a − bq, and any common divisor of b and r must also divide a = bq + r. So the set of common divisors — and hence the HCF — is identical at each step. This is the deep reason why the algorithm works.

Expressing HCF as a Linear Combination (Extended Euclidean Algorithm)

A powerful extension: the HCF of a and b can always be written as HCF(a, b) = ax + by for some integers x and y (possibly negative). For example, HCF(56, 15) = 1, and indeed 1 = 56×4 + 15×(−15) = 224 − 225 = −1... adjusting: 1 = 56×(−4) + 15×15 = −224 + 225. This result is called Bézout's Identity and has major applications in solving linear Diophantine equations.

The Key Equation

a=bq+r,0≤r<ba = bq + r, \quad 0 \leq r < b
  • a — Dividend (integer): The number being divided; any positive integer (or non-negative integer in the general statement)
  • b — Divisor (positive integer): The number by which we divide; must be a positive integer
  • q — Quotient (non-negative integer): The whole-number result of the division; equals ⌊a/b⌋ (the floor of a divided by b)
  • r — Remainder (non-negative integer): What is left over after division; satisfies the strict inequality 0 ≤ r < b, ensuring uniqueness

Worked Example

Problem. Find the HCF of 252 and 105 using Euclid's Division Algorithm.

HCF(252, 105)=21\text{HCF}(252,\,105) = 21

Answer. HCF(252, 105) = 21

Figure
Diagram
Euclidean Algorithm: HCF(252, 105)Step 1252 = 105 × 2 + 42 (remainder = 42)Step 2105 = 42 × 2 + 21 (remainder = 21)Step 342 = 21 × 2 + 0 (remainder = 0 ✓ STOP)HCF(252, 105) = 21Last non-zero remaindera=252, b=105a=105, b=42a=42, b=21
Origins · 1 minEuclid of Alexandria and how this was discovered
EO
Euclid of Alexandria
-325–-265 · Greek (Alexandria, Egypt)

Euclid compiled and systematized Greek mathematical knowledge in his 13-volume work Elements (c. 300 BCE), which remained the standard geometry and number theory textbook for over 2000 years. Book VII of Elements contains the division algorithm that bears his name, along with proofs of fundamental results about divisibility and prime numbers including the fact that there are infinitely many primes. When King Ptolemy I of Egypt asked Euclid if there was a shorter route to mastering geometry than studying Elements, Euclid reportedly replied: 'There is no royal road to geometry.' This quote has echoed through centuries as a reminder that mathematical understanding requires genuine effort.

  • HCF and LCM — Euclid's Division Algorithm is the most efficient method for computing the HCF of two integers; once HCF is known, LCM follows immediately from the relation LCM(a,b) = ab / HCF(a,b).
  • Prime Factorization — Euclid's lemma (a related result) states that if a prime p divides ab, then p divides a or p divides b — this is the key to proving the Fundamental Theorem of Arithmetic, which guarantees unique prime factorization.
  • Divisibility and Remainders — The division lemma formalizes the concept of remainder, making it the gateway to understanding divisibility tests, modular arithmetic, and congruences.
  • Irrational Numbers — Euclid's method of proof by contradiction — used to establish the division algorithm's uniqueness — is the same style of reasoning used to prove that √2 is irrational.