Divisibility and the Division Algorithm

⚡ Key Takeaways

Divisibility is the relation "aa divides bb" (written a∣ba \mid b), meaning bb is an exact integer multiple of aa. The Division Algorithm guarantees that for any integer aa and positive integer bb, there exist unique integers qq (quotient) and rr (remainder) with a=bq+ra = bq + r and 0≤r<b0 \le r < b. This pair of ideas underpins all of elementary number theory — gcd computation, modular arithmetic, primes, and congruences. The concepts trace to Euclid (c. 300 BCE) and were axiomatized in the 19th century.

💡 The Core Insight

Every integer, when measured against a positive "ruler" bb, lands in exactly one of the half-open intervals [bq,b(q+1))[bq, b(q+1)). The integer bqbq is the largest multiple of bb not exceeding aa, and the leftover distance r=a−bqr = a - bq is the remainder, forced to satisfy 0≤r<b0 \le r < b. Divisibility is precisely the special case r=0r = 0. Thus the whole arithmetic of factors collapses into one clean equation a=bq+ra = bq + r with a tightly constrained remainder.

Formal Statement

DefinitionDivisibility

Let a,b∈Za, b \in \mathbb{Z}. We say aa divides bb, written a∣ba \mid b, if there exists k∈Zk \in \mathbb{Z} such that

1
b=ak.\quad b = a k.

Derivation hint: This is the definition itself — a∣ba \mid b means bb is an integer multiple of aa. Here aa is the <strong>divisor</strong>, bb the <strong>dividend</strong> (or multiple), and kk the cofactor. When no such kk exists, we write a∤ba \nmid b. Note a∣0a \mid 0 for every aa (take k=0k = 0), while 0∣b0 \mid b only when b=0b = 0.

DefinitionBasic Properties of Divisibility

For all integers a,b,ca, b, c:

2
a∣b and b∣c ⟹ a∣c(transitivity).\quad a \mid b \ \text{and}\ b \mid c \ \Longrightarrow\ a \mid c \quad(\text{transitivity}).

Derivation hint: From b=ak1b = ak_1 and c=bk2c = bk_2, substitute to get c=a(k1k2)c = a(k_1 k_2), an integer multiple of aa.

3
a∣b and a∣c ⟹ a∣(bx+cy)for all x,y∈Z.\quad a \mid b \ \text{and}\ a \mid c \ \Longrightarrow\ a \mid (bx + cy) \quad \text{for all } x, y \in \mathbb{Z}.

Derivation hint: Write b=ak1b = a k_1, c=ak2c = a k_2; then bx+cy=a(k1x+k2y)bx + cy = a(k_1 x + k_2 y), again a multiple of aa. The combination bx+cybx+cy is an <strong>integer linear combination</strong>.

4
a∣b and b∣a ⟹ a=±b.\quad a \mid b \ \text{and}\ b \mid a \ \Longrightarrow\ a = \pm b.

Derivation hint: b=akb = ak, a=bma = bm give a=akma = akm, so km=1km = 1 (if a≠0a \ne 0), forcing k=m=±1k = m = \pm 1. The zero case gives a=b=0a=b=0.

5
a∣b and b≠0 ⟹ ∣a∣≤∣b∣.\quad a \mid b \ \text{and}\ b \ne 0 \ \Longrightarrow\ |a| \le |b|.

Derivation hint: b=akb = ak with b≠0b \ne 0 forces k≠0k \ne 0, so ∣k∣≥1|k| \ge 1, hence ∣b∣=∣a∣∣k∣≥∣a∣|b| = |a||k| \ge |a|.

TheoremThe Division Algorithm

Let a∈Za \in \mathbb{Z} and b∈Zb \in \mathbb{Z} with b>0b > 0. Then there exist unique integers qq (the quotient) and rr (the remainder) satisfying

6
a=bq+r,0≤r<b.\quad a = b q + r, \qquad 0 \le r < b.

Derivation hint: Existence comes from the Well-Ordering Principle applied to the set of non-negative values a−bqa - bq; uniqueness from the tight bound 0≤r<b0 \le r < b. See the proof below. More generally, for b≠0b \ne 0 (allowing b<0b<0) one requires 0≤r<∣b∣0 \le r < |b|, and q,rq, r are again unique.

DefinitionThe mod operator and quotient

Given the unique q,rq, r from [6], define

7
a  b:=r,a÷b:=q=⌊ab⌋.\quad a \bmod b := r, \qquad a \div b := q = \left\lfloor \frac{a}{b} \right\rfloor.

Derivation hint: rr is what remains after removing the largest multiple bq≤abq \le a; the quotient is the floor of the real-number ratio because bq≤a<b(q+1)bq \le a < b(q+1) rearranges to q≤a/b<q+1q \le a/b < q+1. Then by construction b∣a  ⟺  (a  b)=0b \mid a \iff (a \bmod b) = 0.

Why It Holds / Derivation

ProofExistence and Uniqueness in the Division Algorithm

Setup. Fix a∈Za \in \mathbb{Z}, b>0b > 0. Consider the set of non-negative "shifted" values

8
S={ a−bq:q∈Z, a−bq≥0 }⊆Z≥0.\quad S = \{\, a - b q : q \in \mathbb{Z},\ a - bq \ge 0 \,\} \subseteq \mathbb{Z}_{\ge 0}.

Derivation hint: We collect all candidate remainders; the smallest will be the true remainder.

Step 1 — SS is non-empty. Choosing q=−∣a∣q = -|a| gives a−bq=a+b∣a∣≥a+∣a∣≥0a - bq = a + b|a| \ge a + |a| \ge 0 (since b≥1b \ge 1). So SS contains at least one non-negative integer.

Step 2 — SS has a least element. By the Well-Ordering Principle, every non-empty subset of Z≥0\mathbb{Z}_{\ge 0} has a smallest element. Let rr be the least element of SS, attained at some qq, so a=bq+ra = bq + r with r≥0r \ge 0.

Step 3 — r<br < b. Suppose for contradiction r≥br \ge b. Then

9
a−b(q+1)=(a−bq)−b=r−b≥0,\quad a - b(q+1) = (a - bq) - b = r - b \ge 0,

Derivation hint: Subtracting one more copy of bb keeps the value non-negative if r≥br \ge b. so r−b∈Sr - b \in S. But r−b<rr - b < r contradicts minimality of rr. Hence r<br < b. This establishes existence with 0≤r<b0 \le r < b.

Step 4 — Uniqueness. Suppose a=bq1+r1=bq2+r2a = bq_1 + r_1 = bq_2 + r_2 with 0≤r1,r2<b0 \le r_1, r_2 < b. Subtracting,

10
b(q1−q2)=r2−r1.\quad b(q_1 - q_2) = r_2 - r_1.

Derivation hint: Equate the two representations and isolate the multiple of bb. Now ∣r2−r1∣<b|r_2 - r_1| < b because both lie in [0,b)[0, b). Thus b∣(r2−r1)b \mid (r_2 - r_1) with ∣r2−r1∣<b|r_2 - r_1| < b forces r2−r1=0r_2 - r_1 = 0, so r1=r2r_1 = r_2, and then b(q1−q2)=0b(q_1 - q_2) = 0 with b>0b > 0 gives q1=q2q_1 = q_2. ■\blacksquare

∎
⚠️ Floor convention for negative dividends

The standard theorem requires 0≤r<b0 \le r < b even when a<0a < 0. For a=−17a = -17, b=5b = 5 the correct output is q=−4q = -4, r=3r = 3 (since −17=5(−4)+3-17 = 5(-4) + 3), not q=−3,r=−2q=-3, r=-2. Many programming languages' `%` operator instead returns a remainder with the sign of aa (so `-17 % 5 == -3` in C/Java). The mathematical "mod" is the non-negative representative.

mathematician · Euclid of Alexandria | fl. c. 300 BCE

Euclid's Elements, Book VII, lays out the first systematic theory of divisibility for the ancient Greeks, who treated numbers as lengths of line segments. Propositions VII.1 and VII.2 present what we now call the Euclidean Algorithm — anthyphairesis, "reciprocal subtraction" — for finding the greatest common measure of two magnitudes. Euclid did not have the modern symbolic Division Algorithm, but his repeated-subtraction method is its iterated application. The conceptual leap to a stand-alone existence-and-uniqueness theorem with explicit quotient and remainder came much later, crystallizing in the 19th-century arithmetization of number theory by Gauss and Dirichlet.

Building Intuition

🧠 Intuition

Picture the integer number line and lay down evenly spaced fence posts at every multiple of bb: …,−b,0,b,2b,3b,…\dots, -b, 0, b, 2b, 3b, \dots. Your number aa sits somewhere on this line. The quotient qq tells you which fence post is immediately at or to the left of aa, and the remainder rr is how far past that post you have to walk to reach aa. Because consecutive posts are exactly bb apart, you can never have to walk a full bb or more to reach the next number — that would mean you'd passed a post — so 0≤r<b0 \le r < b is geometrically inevitable. Divisibility (b∣ab \mid a) is the case where aa lands exactly on a post, with nothing left over.

Figure
Division Algorithm as fence posts: a = bq + r on the number line

```svg

a = bq + r with 0 ≤ r < b (here b = 5, a = 17, q = 3, r = 2) 0 5 10 bq = 15 20 a = 17 r = 2 bq = 5·3 = 15 (largest multiple of b ≤ a)

```

Worked Examples

ExamplePositive dividend

Given: a=247a = 247, b=13b = 13. Find qq, rr, and decide whether 13∣24713 \mid 247.

Steps: 1. Estimate the quotient: 247/13≈19.0247 / 13 \approx 19.0, so try q=19q = 19. 2. Compute bq=13×19=247bq = 13 \times 19 = 247. 3. Remainder: r=a−bq=247−247=0r = a - bq = 247 - 247 = 0. 4. Check the bound: 0≤0<130 \le 0 < 13. ✓ Since r=0r = 0, the dividend is an exact multiple.

q=19,r=0,13∣247\boxed{q = 19,\quad r = 0,\quad 13 \mid 247}
ExampleNegative dividend (the subtle case)

Given: a=−100a = -100, b=7b = 7. Find the mathematical qq, rr with 0≤r<70 \le r < 7.

Steps: 1. Real ratio: −100/7≈−14.2857-100 / 7 \approx -14.2857. 2. Quotient is the floor: q=⌊−14.2857⌋=−15q = \lfloor -14.2857 \rfloor = -15 (round down, toward −∞-\infty). 3. Compute bq=7×(−15)=−105bq = 7 \times (-15) = -105. 4. Remainder: r=a−bq=−100−(−105)=5r = a - bq = -100 - (-105) = 5. 5. Check the bound: 0≤5<70 \le 5 < 7. ✓ And verify: 7(−15)+5=−105+5=−1007(-15) + 5 = -105 + 5 = -100. ✓

q=−15,r=5,−100  7=5\boxed{q = -15,\quad r = 5,\quad -100 \bmod 7 = 5}

Note: a naive truncation toward zero would give q=−14,r=−2q=-14, r=-2, which violates r≥0r \ge 0 — wrong by the theorem's convention.

Common Misconceptions

⚠️ Divisor versus dividend, and the 00 confusions
  • "a∣ba \mid b" means aa is the smaller-or-equal factor and bb the multiple — students frequently invert the bar's direction. Read "∣\mid" as "divides into": 3∣123 \mid 12 is true ("3 divides into 12"), 12∣312 \mid 3 is false.
  • a∣0a \mid 0 is true for all aa (including aa negative), since 0=a⋅00 = a \cdot 0. In particular 0∣00 \mid 0 is true.
  • 0∣b0 \mid b is false unless b=0b = 0. Dividing by zero is undefined, but the divisibility relation "0∣b0 \mid b" is a perfectly well-formed (usually false) statement.
  • Divisibility is not the fraction b/ab/a; it is a yes/no relation on integers. 125\frac{12}{5} exists as a rational number even though 5∤125 \nmid 12.
CounterexampleWhy b>0b>0 matters for uniqueness without absolute value

If we drop the constraint 0≤r<b0 \le r < b and merely demand a=bq+ra = bq + r, representations are wildly non-unique. With a=17,b=5a = 17, b = 5:

17=5⋅3+2=5⋅2+7=5⋅4+(−3)=5⋅0+17.17 = 5\cdot 3 + 2 = 5\cdot 2 + 7 = 5\cdot 4 + (-3) = 5\cdot 0 + 17.

All are valid as equations, but only q=3,r=2q=3, r=2 obeys 0≤r<50 \le r < 5. The remainder bound is precisely what pins down a unique answer — it is not decorative.

CounterexampleTransitivity does not run backward

From 4∣124 \mid 12 it does not follow that 4∣64 \mid 6 even though 6∣126 \mid 12. Divisibility of a common multiple by aa says nothing about the intermediate factor: 6∣126 \mid 12 and 4∣124 \mid 12 but 4∤64 \nmid 6. (Transitivity flows a∣b∣c⇒a∣ca\mid b \mid c \Rightarrow a \mid c, not sideways.)

Connections

connection

The Division Algorithm is the engine driving the entire elementary theory:

  • Iterating it on (a,b)(a,b), then (b,r)(b,r), then (r,r′)(r, r'), ... is exactly the Euclidean Algorithm, whose final non-zero remainder is gcd⁡(a,b)\gcd(a,b).
  • The relation a≡a′(modb)  ⟺  (a  b)=(a′  b)a \equiv a' \pmod b \iff (a \bmod b) = (a' \bmod b) launches Modular Arithmetic and the ring Z/nZ\mathbb{Z}/n\mathbb{Z}.
  • Divisibility plus the Fundamental Theorem of Arithmetic reduces every divisibility question to comparing prime exponents.
  • Abstracting "a division algorithm exists" gives the notion of a Euclidean Domain, a special class of integral domain where unique factorization is guaranteed.
  • The set of integer linear combinations {ax+by}\{ax + by\} from property [3] is the ideal (a,b)=(gcd⁡(a,b))(a,b) = (\gcd(a,b)), the entry point to ring theory.

Real-World Applications

🔬 Where this appears

Historical Development

⏳ History
- c. 300 BCE — Euclid's Elements, Book VII. Anthyphairesis (mutual subtraction) for the greatest common measure; the algorithmic seed of division with remainder.
- c. 250 CE — Diophantus, Arithmetica. Systematic study of integer and rational solutions, sharpening interest in factors and divisibility.
- c. 500–600 CE — Aryabhata & Brahmagupta (India). The kuṭṭaka ("pulverizer") method solves linear Diophantine equations via iterated division, anticipating the extended Euclidean algorithm.
- 1202 — Fibonacci's Liber Abaci. Brings Hindu–Arabic numerals and remainder arithmetic to Europe, popularizing practical division.
- 1801 — Gauss's Disquisitiones Arithmeticae. Formalizes congruence notation a≡b(modm)a \equiv b \pmod m, founded directly on remainders, and elevates divisibility to a rigorous discipline.
- 1837 — Dirichlet. Uses divisibility and arithmetic progressions to prove infinitely many primes in a+nda + nd, deepening the structural role of remainders.
- 1888 — Dedekind & Peano. The Peano axioms and the Well-Ordering Principle give the Division Algorithm its modern, fully rigorous proof foundation.
- 1960s — Knuth, The Art of Computer Programming, Vol. 2. Treats the Division Algorithm and Euclid's method as cornerstone computational objects, analyzing complexity precisely.
- Late 20th c. — Euclidean domains. Abstract algebra generalizes the Division Algorithm to polynomial rings and Gaussian integers, unifying integer and polynomial division.

Subtleties & Limits

open-problem

While the Division Algorithm itself is settled, the divisibility questions it spawns include some of mathematics' deepest open problems. Factoring — given nn, find its divisors — has no known polynomial-time classical algorithm, and its presumed hardness secures RSA; whether P=NP\mathrm{P} = \mathrm{NP} or a sub-exponential classical factoring algorithm exists remains open. The distribution of divisors fuels the Erdős–Straus conjecture (is 4/n=1/x+1/y+1/z4/n = 1/x + 1/y + 1/z solvable for all n≥2n \ge 2?) and the still-open question of whether there exist odd perfect numbers (an integer equal to the sum of its proper divisors). In ring theory, classifying which number rings admit a Euclidean function (are norm-Euclidean) is unresolved in general — e.g., Z[14]\mathbb{Z}[\sqrt{14}] was only relatively recently shown Euclidean by a non-norm function.

See Also

Euclidean Algorithm · Modular Arithmetic · Fundamental Theorem of Arithmetic · Greatest Common Divisor · Prime Numbers · Linear Diophantine Equations · Euclidean Domain · Congruence Relations · Bézout's Identity