Maths in Real Life

Euclid's Division Lemma (a = bq + r): Statement, Proof and Examples

EuclidCurve Smart Team · 2026-11-12 · 6 min read

For young mathematicians in the UK, USA, UAE, Singapore and Hong Kong

Every time you do a long division and write down a remainder, you are using Euclid's division lemma. It is one of the simplest facts in number theory, and one of the most useful.

Euclid's division lemma: for any positive integers a and b there are unique integers q (the quotient) and r (the remainder) with a = bq + r and 0 \le r < b.

Guess first: When −17 is divided by 5 in the lemma's sense, what is the remainder?

  • −2
  • 2
  • 3

The remainder must satisfy 0 \le r < 5, so it cannot be negative: -17 = 5 × (-4) + 3. The remainder is 3. (The lemma is usually stated for positive integers, but the same idea works for negative ones.)

Examples

17 = 5 × 3 + 2, so q = 3 and r = 2. 100 = 7 × 14 + 2. 36 = 9 × 4 + 0: a remainder of 0 means b divides a exactly.

Your turn

Write 1000 = 37q + r with 0 \le r < 37. What is r?

Solution: 37 × 27 = 999, so 1000 = 37 × 27 + 1 and r = 1.

Why q and r always exist, and are unique

Existence: take the largest multiple of b that is not bigger than a, say bq. Then r = a - bq is at least 0, and it is less than b, because otherwise b(q + 1) would be a bigger multiple still not exceeding a.

Uniqueness: suppose a = bq + r = bq' + r' with both remainders between 0 and b - 1. Then b(q - q') = r' - r. The right side is between -(b-1) and b - 1, but the left side is a multiple of b, so both sides must be 0. Hence q = q' and r = r'.

What it is used for

Dividing by 2, every integer is 2q or 2q + 1: even or odd, with nothing in between. Dividing by 3, every integer is 3q, 3q + 1 or 3q + 2. Splitting numbers into these cases is a classic proof technique.

A favourite Class 10 example: the square of any odd integer has the form 8m + 1. An odd number is 2k + 1, and (2k + 1)² = 4k(k + 1) + 1. One of k and k + 1 is even, so 4k(k + 1) is a multiple of 8.

Your turn

What is the remainder when the square of any odd number is divided by 8?

Solution: 9 = 8 + 1, 25 = 3 × 8 + 1, 49 = 6 × 8 + 1. In general (2k+1)² = 4k(k+1) + 1, and 4k(k+1) is a multiple of 8, so the remainder is always 1.

Used over and over, the division lemma becomes Euclid's algorithm for the HCF, the subject of our next post.

Practice: master the division lemma

Guess first: Practice 1: Which is the correct division-lemma form for a = 58 and b = 6?

  • 58 = 6 × 9 + 4
  • 58 = 6 × 8 + 10
  • 58 = 6 × 10 − 2

58 = 6 × 9 + 4, and 0 \le 4 < 6. The other two break the rule 0 \le r < b: 10 is too big and -2 is negative.

Your turn

Practice 2: Write 2026 = 45q + r with 0 \le r < 45. What is r?

Solution: 45 × 45 = 2025, so 2026 = 45 × 45 + 1 and r = 1.

Guess first: Practice 3: When any integer is divided by 4, which remainders are possible?

  • 0, 1, 2, 3
  • 1, 2, 3, 4
  • 0, 1, 2, 3, 4

The lemma says 0 \le r < 4, so the remainder is 0, 1, 2 or 3. Every integer is 4q, 4q + 1, 4q + 2 or 4q + 3.

Your turn

Practice 4: For any integer n, what is the remainder when n² + n is divided by 2?

Solution: n² + n = n(n+1). If n = 2q the product has the factor 2q; if n = 2q + 1 then n + 1 = 2q + 2 is even. Either way n(n+1) is even, so the remainder is 0.

Your turn

Practice 5: Every prime greater than 3 can be written as 6q + r. Two values of r are possible. Enter the larger one.

Solution: 6q, 6q + 2 and 6q + 4 are even, and 6q + 3 is a multiple of 3, so none of them can be a prime greater than 3. Only 6q + 1 and 6q + 5 remain; the larger r is 5.

Quick questions

What is Euclid's division lemma?

For any positive integers a and b there are unique integers q and r with a = bq + r and 0 ≤ r < b. It is long division written as an equation.

What is the difference between Euclid's division lemma and Euclid's algorithm?

The division lemma is one division step, a = bq + r. Euclid's algorithm repeats that step to find the HCF of two numbers.

Can the remainder be negative?

No. In the lemma the remainder always satisfies 0 ≤ r < b; for example −17 = 5 × (−4) + 3, so the remainder is 3.

Written by the EuclidCurve Smart Team. We are the maths and physics tutors behind EuclidCurve. We teach IB, AMC, ESAT and TMUA students in the UK, USA, UAE, Singapore and Hong Kong, and we write about the maths hiding in everyday life.

Keep exploring

Book a free class · Try today's IMO problem