Skip to content

The Division Algorithm

The division algorithm is one of the basic structural facts about the integers. It says that any integer can be divided by a positive integer with a unique quotient and remainder.

Statement of the Algorithm

The division algorithm is one of the basic structural facts about the integers. It says that any integer can be divided by a positive integer with a unique quotient and remainder.

Let aZa\in\mathbb{Z} and let bNb\in\mathbb{N}. Then there exist unique integers qq and rr such that

a=bq+r, a=bq+r,

where

0r<b. 0\le r<b.

The integer qq is called the quotient, and rr is called the remainder.

For example, if

a=29,b=5, a=29, \qquad b=5,

then

29=55+4. 29=5\cdot5+4.

Thus the quotient is 55, and the remainder is 44.

Meaning of the Remainder

The remainder measures the part of aa left after subtracting the largest suitable multiple of bb.

For instance,

29=55+4 29=5\cdot5+4

means that 55=255\cdot5=25 is the largest multiple of 55 not exceeding 2929, and the remaining part is 44.

The condition

0r<b 0\le r<b

is essential. It ensures that the remainder is chosen from exactly one of the possibilities

0,1,2,,b1. 0,1,2,\ldots,b-1.

Without this condition, many decompositions would be possible. For example,

29=55+4 29=5\cdot5+4

but also

29=54+9. 29=5\cdot4+9.

Only the first has a remainder between 00 and 44.

Divisibility as Zero Remainder

The division algorithm connects division with divisibility.

For integers aa and positive bb,

ba b\mid a

if and only if the remainder on division of aa by bb is 00.

Indeed, if bab\mid a, then

a=bq a=bq

for some integer qq, so

a=bq+0. a=bq+0.

Conversely, if

a=bq+0, a=bq+0,

then

a=bq, a=bq,

and therefore

ba. b\mid a.

Thus divisibility is exact division, while the division algorithm describes the general case.

Examples

Dividing 4343 by 77, we obtain

43=76+1. 43=7\cdot6+1.

Thus

q=6,r=1. q=6, \qquad r=1.

Dividing 100100 by 99, we get

100=911+1. 100=9\cdot11+1.

Dividing 8484 by 1212, we get

84=127+0. 84=12\cdot7+0.

The zero remainder shows that

1284. 12\mid84.

Negative dividends are also allowed. For example, dividing 17-17 by 55, we require

0r<5. 0\le r<5.

The correct expression is

17=5(4)+3. -17=5(-4)+3.

Thus

q=4,r=3. q=-4, \qquad r=3.

Although

17=5(3)2, -17=5(-3)-2,

this expression does not satisfy the required condition because the remainder is negative.

Existence

We sketch why the quotient and remainder must exist.

Let aZa\in\mathbb{Z} and bNb\in\mathbb{N}. Consider the set

S={abq:qZ, abq0}. S=\{a-bq:q\in\mathbb{Z},\ a-bq\ge0\}.

This set contains all nonnegative integers obtained by subtracting multiples of bb from aa.

The set SS is nonempty. By taking qq sufficiently negative, the number abqa-bq becomes positive.

By the well-ordering principle, SS has a least element. Call it rr. Then

r=abq r=a-bq

for some integer qq, so

a=bq+r. a=bq+r.

It remains to show that

r<b. r<b.

If rbr\ge b, then

rb0. r-b\ge0.

But

rb=abqb=ab(q+1), r-b=a-bq-b=a-b(q+1),

so rbr-b also belongs to SS. This contradicts the minimality of rr. Therefore

0r<b. 0\le r<b.

Uniqueness

Suppose there are two decompositions:

a=bq+r a=bq+r

and

a=bq+r, a=bq'+r',

where

0r<b,0r<b. 0\le r<b, \qquad 0\le r'<b.

Subtracting the two equations gives

b(qq)=rr. b(q-q')=r'-r.

Thus

b(rr). b\mid(r'-r).

But since rr and rr' both lie between 00 and b1b-1, we have

(b1)rrb1. -(b-1)\le r'-r\le b-1.

The only multiple of bb in this range is 00. Hence

rr=0. r'-r=0.

So

r=r. r=r'.

Then

b(qq)=0, b(q-q')=0,

which gives

q=q. q=q'.

Therefore the quotient and remainder are unique.

Division into Residue Classes

The possible remainders modulo bb are

0,1,2,,b1. 0,1,2,\ldots,b-1.

Every integer belongs to exactly one of these remainder classes.

For example, modulo 55, every integer has one of the remainders

0,1,2,3,4. 0,1,2,3,4.

Thus the division algorithm partitions the integers into five classes:

5q,5q+1,5q+2,5q+3,5q+4. 5q,\quad 5q+1,\quad 5q+2,\quad 5q+3,\quad 5q+4.

This idea is the foundation of congruence arithmetic.

Role in Number Theory

The division algorithm is the basis of many central tools in number theory.

It underlies the Euclidean algorithm, which computes greatest common divisors. It defines remainders, which lead to congruences and modular arithmetic. It also provides the structure needed for proofs involving minimal counterexamples and descent.

Although the statement is elementary, its consequences are extensive. Much of elementary number theory begins with the simple fact that every integer can be written uniquely as

a=bq+r,0r<b. a=bq+r, \qquad 0\le r<b.