The Greatest Common Divisor

Suppose two gears have 6060 and 4848 teeth. What is the largest "unit size" that divides both counts evenly? This should allow the gears' motion to be described in synchronized whole cycles. This is the concrete question behind the greatest common divisor. It is one of the oldest and most load-bearing ideas in number theory. It quietly underlies fraction simplification, modular arithmetic, cryptographic key generation, and the structure of the integers themselves. The idea matters because divisibility alone is a coarse relation. Many numbers divide a given pair. We need a way to isolate the best common measure. The gcd packages all common divisors of two integers into a single number. This number captures exactly their shared arithmetic structure. Once this number is understood correctly, deeper facts follow. It can be written as an integer combination of the two numbers. It is computable efficiently. It governs solvability of linear Diophantine equations. The big picture is that gcd⁡\gcd is not just an operation. It is a universal object: the largest element, in the divisibility ordering, that lies below both inputs. This lattice-theoretic viewpoint explains why gcd behaves so well algebraically. It interacts cleanly with multiplication and distributes over products. It also gives rise to the notion of coprimality, the condition of having no shared structure at all. This article gives the precise definition of gcd⁡(a,b)\gcd(a,b). It establishes its basic existence and uniqueness. It proves the core elementary properties: linearity under common factors, behavior under scaling, coprimality criteria. It also sets up the language needed for the Euclidean Algorithm and Bezout's Identity. These show how to compute and represent the gcd explicitly.

Key takeaways
  • The gcd of integers a,ba,b (not both zero) is the largest integer dividing both.
  • Equivalently, it is characterized by a divisibility-universal property: every common divisor divides it.
  • gcd⁡(a,b)\gcd(a,b) exists and is unique for any pair not both zero, by well-ordering.
  • aa and bb are coprime (or relatively prime) when gcd⁡(a,b)=1\gcd(a,b) = 1.
  • Key identities: gcd⁡(a,b)=gcd⁡(b,a)=gcd⁡(∣a∣,∣b∣)=gcd⁡(a,b−qa)\gcd(a,b) = \gcd(b,a) = \gcd(|a|,|b|) = \gcd(a, b - qa) for any integer qq.
  • Key idea: the gcd is the unique nonnegative generator of the set of all integer combinations {ax+by:x,y∈Z}\{ax + by : x,y \in \mathbb{Z}\}, a fact whose proof foreshadows Bezout's identity.

Where this lives today

The gcd is the load-bearing gear of elementary number theory: it is the precise tool that reduces fractions to lowest terms (ab=a/db/d\tfrac{a}{b} = \tfrac{a/d}{b/d} with d=gcd⁡(a,b)d=\gcd(a,b)), and it is the exact solvability criterion for the linear Diophantine equation ax+by=cax+by=c (solvable in integers iff gcd⁡(a,b)∣c\gcd(a,b) \mid c, a direct consequence of Bezout's identity above). In modular arithmetic, gcd⁡(a,n)=1\gcd(a,n)=1 is precisely the condition for aa to be invertible modulo nn, which is the backbone of the RSA cryptosystem: key generation requires choosing an encryption exponent ee coprime to φ(n)\varphi(n), and decryption relies on computing its modular inverse via the extended Euclidean algorithm. In computer science, the gcd computation is a textbook example of an algorithm with provably efficient (logarithmic) running time, underlying implementations in every major arithmetic library. In algebra, the notion generalizes to principal ideal domains, where gcd is defined via ideal containment exactly mirroring the universal property given here; this generalization is essential in ring theory and algebraic number theory. In combinatorics and dynamical systems, gcd⁡\gcd of periods governs the structure of orbits and lattice points, e.g. determining when a line through the origin with rational slope p/qp/q (in lowest terms) first returns to a lattice point.

Ask the tutor: How does the Euclidean Algorithm turn the reduction property gcd⁡(a,b)=gcd⁡(a,b−qa)\gcd(a,b)=\gcd(a,b-qa) into a concrete finite procedure, and how do we extract the Bezout coefficients x0,y0x_0,y_0 from it?

DefinitionGreatest Common Divisor

Let a,b∈Za, b \in \mathbb{Z}, not both zero. An integer dd is a common divisor of aa and bb if d∣ad \mid a and d∣bd \mid b. The greatest common divisor of aa and bb, written gcd⁡(a,b)\gcd(a,b), is the unique integer dd satisfying: 1. d>0d > 0; 2. d∣ad \mid a and d∣bd \mid b (i.e., dd is a common divisor); 3. for every common divisor cc of aa and bb, c∣dc \mid d. Condition (3) is the universal property: dd is not merely numerically the largest common divisor, it is divisible by every common divisor. We will show (Theorem below) that such a dd exists and is unique, and that it coincides with the largest common divisor in the usual numerical sense. Two integers a,ba, b are called coprime (or relatively prime) if gcd⁡(a,b)=1\gcd(a,b) = 1. By convention, gcd⁡(0,0)\gcd(0,0) is left undefined (every integer divides 00, so there is no largest common divisor of 00 and 00), and gcd⁡(0,a)=∣a∣\gcd(0,a) = |a| for a≠0a \neq 0.

Intuition

Think of divisibility as an ordering on the positive integers: m⪯nm \preceq n means m∣nm \mid n. Under this order, not every pair of numbers is comparable — 44 and 66 neither divide each other — but every pair still has a well-defined meet, a greatest lower bound in the divisibility order. That meet is exactly gcd⁡(4,6)=2\gcd(4,6) = 2. The gcd is the divisibility-lattice analogue of "the larger of two numbers" under the usual order ≤\leq. A second, equally important picture: fix aa and bb, and look at the set of all integer combinations

I={ax+by:x,y∈Z}.I = \{ax + by : x, y \in \mathbb{Z}\}.

This set is closed under addition and under multiplication by any integer, and it contains both aa and bb (take (x,y)=(1,0)(x,y) = (1,0) or (0,1)(0,1)). It turns out II consists precisely of all multiples of a single positive integer — and that integer is gcd⁡(a,b)\gcd(a,b). This is the seed of Bezout's Identity, which asserts gcd⁡(a,b)=ax0+by0\gcd(a,b) = ax_0 + by_0 for suitable integers x0,y0x_0, y_0; we prove the existence half of this fact below as part of establishing gcd's universal property.

Figure
Divisors of 60 and 48 on the divisibility lattice, meeting at 12
Common divisors of 60 and 48 Divisors of 60 1, 2, 3, 4, 5, 6, 10, 12, 15, 20, 30, 60 Divisors of 48 1, 2, 3, 4, 6, 8, 12, 16, 24, 48 5, 10, 15, 20, 30, 60 8, 16, 24, 48 1, 2, 3, 4, 6, 12 common divisors gcd(60,48) = 12 — largest, and every common divisor divides it
TheoremExistence, Uniqueness, and Characterization of the GCD

Let a,b∈Za, b \in \mathbb{Z}, not both zero. Then:

(a) Existence and Bezout representation. There exists a positive integer dd such that

d=min⁡{ax+by>0:x,y∈Z},d = \min\{ ax + by > 0 : x, y \in \mathbb{Z} \},

and this dd satisfies d∣ad \mid a, d∣bd \mid b, and for every common divisor cc of a,ba,b we have c∣dc \mid d.

(b) Uniqueness. There is exactly one positive integer satisfying properties (1)–(3) of the definition above; hence gcd⁡(a,b)=d\gcd(a,b) = d.

(c) Coincidence with the numerical maximum. dd equals the largest element of the (finite, nonempty) set of common divisors of aa and bb under the usual ordering ≤\leq on integers.

Proof

We use the Well-Ordering Principle (every nonempty set of positive integers has a least element) together with the Division Algorithm.

Step 1: The set of positive integer combinations is nonempty. Let

S={ax+by:x,y∈Z}∩Z>0.S = \{ ax + by : x, y \in \mathbb{Z} \} \cap \mathbb{Z}_{>0}.

Since a,ba, b are not both zero, at least one of a,−a,b,−ba, -a, b, -b is a positive integer, and each of these is of the form ax+byax+by (e.g. a=a⋅1+b⋅0a = a\cdot 1 + b \cdot 0, −a=a⋅(−1)+b⋅0-a = a \cdot(-1) + b\cdot 0, similarly for bb). Hence S≠∅S \neq \emptyset.

Step 2: Existence of a minimal element. By the Well-Ordering Principle, SS has a least element dd. Write d=ax0+by0d = a x_0 + b y_0 for some x0,y0∈Zx_0, y_0 \in \mathbb{Z}; note d>0d > 0.

Step 3: dd divides aa. Apply the Division Algorithm to divide aa by dd: there exist unique q,r∈Zq, r \in \mathbb{Z} with

a=qd+r,0≤r<d.a = qd + r, \qquad 0 \le r < d.

Then

r=a−qd=a−q(ax0+by0)=a(1−qx0)+b(−qy0),r = a - qd = a - q(ax_0 + by_0) = a(1 - qx_0) + b(-qy_0),

so rr is an integer combination of aa and bb. If r>0r > 0, then r∈Sr \in S and r<dr < d, contradicting minimality of dd in SS. Hence r=0r = 0, so a=qda = qd, i.e. d∣ad \mid a.

Step 4: dd divides bb. By the identical argument with the roles of a,ba,b swapped, d∣bd \mid b. So dd is a positive common divisor of aa and bb, and d=ax0+by0d = ax_0 + by_0 for some integers x0,y0x_0, y_0.

Step 5: Universal property. Let cc be any common divisor of aa and bb: c∣ac \mid a and c∣bc \mid b. By the basic linearity property of divisibility (if c∣ac \mid a and c∣bc \mid b then cc divides any integer combination ax+byax+by), we get

c∣(ax0+by0)=d.c \mid (ax_0 + by_0) = d.

This proves the universal property (3), completing (a).

Step 6: Uniqueness. Suppose dd and d′d' both satisfy properties (1)–(3) of the definition. By property (3) applied to dd as a "common divisor" candidate for the universal property of d′d' — precisely, since dd is itself a common divisor of a,ba,b and d′d' satisfies the universal property — we get d∣d′d \mid d'. Symmetrically, d′∣dd' \mid d. Two positive integers that divide each other must be equal: if d∣d′d \mid d' and d′∣dd' \mid d, write d′=kdd' = kd and d=k′d′d = k' d' for positive integers k,k′k, k'; then d=k′kdd = k'kd, so k′k=1k'k = 1, forcing k=k′=1k = k' = 1 since both are positive integers. Hence d=d′d = d'. This proves (b).

Step 7: Coincidence with the numerical maximum. The set CC of common divisors of a,ba,b is nonempty (it contains 11) and finite: since a,ba,b are not both zero, some one of them, say a≠0a \neq 0, has only finitely many divisors (namely divisors of ∣a∣|a|, at most ∣a∣|a| many, since any divisor ee of a≠0a\neq0 satisfies ∣e∣≤∣a∣|e|\le|a|), and every common divisor of a,ba,b divides aa. So CC has a maximum element MM under ≤\leq. We show M=dM = d. Since d∈Cd \in C (Step 3–4), d≤Md \leq M. Conversely, M∈CM \in C is a common divisor, so by the universal property (Step 5), M∣dM \mid d; since d>0d > 0 and M>0M > 0 (as M≥1M\ge 1), this gives M≤dM \leq d. Hence M=dM = d, proving (c). ■\blacksquare

∎
CorollaryBezout's Identity, weak form

For a,b∈Za, b \in \mathbb{Z} not both zero, there exist integers x0,y0x_0, y_0 such that

gcd⁡(a,b)=ax0+by0.\gcd(a,b) = a x_0 + b y_0.

(This is exactly d=ax0+by0d = ax_0+by_0 established in Step 2–4 of the proof above; the full computational machinery for finding x0,y0x_0,y_0 is the subject of <a class="wiki-link" href="/wiki/math-numthy-bezout-identity" data-track="wiki_article.body.wiki_link">Bezout&#39;s Identity</a> proper, via the extended <span class="wiki-link-missing">Euclidean Algorithm</span>.)

LemmaBasic algebraic properties of gcd

Let a,b,c∈Za,b,c \in \mathbb{Z} with the relevant pairs not both zero. Then: 1. Symmetry: gcd⁡(a,b)=gcd⁡(b,a)\gcd(a,b) = \gcd(b,a). 2. Sign invariance: gcd⁡(a,b)=gcd⁡(∣a∣,∣b∣)\gcd(a,b) = \gcd(|a|,|b|). 3. Reduction: for any integer qq, gcd⁡(a,b)=gcd⁡(a,b−qa)\gcd(a,b) = \gcd(a, b - qa). In particular gcd⁡(a,b)=gcd⁡(a,b  a)\gcd(a,b)=\gcd(a,b \bmod a) when a≠0a\ne 0. 4. Scaling: for k>0k > 0, gcd⁡(ka,kb)=k gcd⁡(a,b)\gcd(ka, kb) = k\,\gcd(a,b). 5. Coprimality criterion: gcd⁡(a,b)=1\gcd(a,b) = 1 if and only if there exist integers x,yx,y with ax+by=1ax + by = 1. 6. Coprime cancellation: if gcd⁡(a,b)=1\gcd(a,b) = 1 and a∣bca \mid bc, then a∣ca \mid c.

Proof

(1) Immediate: the defining conditions "d∣a,d∣bd\mid a, d\mid b" and "every common divisor divides dd" are symmetric in a,ba,b.

(2) The divisors of aa and of ∣a∣|a| are identical (since e∣a  ⟺  e∣−ae \mid a \iff e \mid -a for all ee), so the set of common divisors of {a,b}\{a,b\} equals that of {∣a∣,∣b∣}\{|a|,|b|\}; hence the two gcds, each characterized as the unique positive integer divisible by all elements of this common set and dividing... (more precisely, satisfying the same universal property with respect to the same set of common divisors) — must coincide, by the uniqueness in the Theorem.

(3) Let C1C_1 be the set of common divisors of a,ba,b and C2C_2 the set of common divisors of a,b−qaa, b-qa. We claim C1=C2C_1 = C_2. If c∈C1c \in C_1, then c∣ac\mid a and c∣bc \mid b, so c∣(b−qa)c \mid (b - qa) (divisibility is linear: a common divisor of two numbers divides any integer combination of them), hence c∈C2c \in C_2. Conversely if c∈C2c \in C_2, then c∣ac \mid a and c∣(b−qa)c \mid (b-qa), so c∣((b−qa)+qa)=bc \mid \big((b-qa) + qa\big) = b, hence c∈C1c \in C_1. Since C1=C2C_1 = C_2, the two gcds — each the unique positive integer that is a common divisor from this set and divisible by every element of it — coincide by uniqueness (Theorem, part (b)).

(4) Let d=gcd⁡(a,b)d = \gcd(a,b). We show kdkd satisfies the defining properties for gcd⁡(ka,kb)\gcd(ka,kb). First, kd>0kd > 0. Since d∣ad \mid a, write a=da′a = d a'; then ka=(kd)a′ka = (kd)a', so kd∣kakd \mid ka; similarly kd∣kbkd \mid kb. Now let cc be any common divisor of ka,kbka, kb. By Bezout (Corollary above), write d=ax0+by0d = ax_0+by_0; then

kd=k(ax0+by0)=(ka)x0+(kb)y0,kd = k(ax_0+by_0) = (ka)x_0 + (kb)y_0,

so since c∣kac \mid ka and c∣kbc\mid kb, linearity gives c∣kdc \mid kd. Thus kdkd satisfies all three defining properties, and by uniqueness gcd⁡(ka,kb)=kd=kgcd⁡(a,b)\gcd(ka,kb) = kd = k\gcd(a,b).

(5) (⇒\Rightarrow) If gcd⁡(a,b)=1\gcd(a,b)=1, the Bezout Corollary gives integers x,yx,y with ax+by=1ax+by = 1. (⇐\Leftarrow) Suppose ax+by=1ax+by=1 for some integers x,yx,y. Let d=gcd⁡(a,b)d=\gcd(a,b) (exists since not both a,ba,b are zero, as ax+by=1≠0ax+by=1\ne 0 forces at least one nonzero). Since d∣ad\mid a and d∣bd\mid b, linearity gives d∣(ax+by)=1d \mid (ax+by) = 1. As d>0d>0 is a positive divisor of 11, d=1d=1.

(6) Since gcd⁡(a,b)=1\gcd(a,b)=1, by (5) choose integers x,yx,y with ax+by=1ax+by=1. Multiply by cc:

acx+bcy=c.acx + bcy = c.

Now a∣acxa \mid acx trivially, and a∣bcya \mid bcy because a∣bca\mid bc by hypothesis. Hence aa divides the sum acx+bcy=cacx+bcy = c. ■\blacksquare

∎

Worked examples

Example 1: Computing gcd⁡(1035,621)\gcd(1035, 621) via the reduction lemma, and verifying the universal property directly. We use Lemma property (3) repeatedly (this is precisely the mechanism behind the Euclidean Algorithm, though we verify it by hand here rather than invoking that theorem):

1035=1⋅621+414⇒gcd⁡(1035,621)=gcd⁡(621,414).1035 = 1\cdot 621 + 414 \quad\Rightarrow\quad \gcd(1035,621)=\gcd(621,414).
621=1⋅414+207⇒gcd⁡(621,414)=gcd⁡(414,207).621 = 1\cdot 414 + 207 \quad\Rightarrow\quad \gcd(621,414)=\gcd(414,207).
414=2⋅207+0⇒gcd⁡(414,207)=gcd⁡(207,0)=207.414 = 2\cdot 207 + 0 \quad\Rightarrow\quad \gcd(414,207)=\gcd(207,0)=207.

So gcd⁡(1035,621)=207\gcd(1035,621) = 207. Direct check via the definition. Factor: 1035=32⋅5⋅231035 = 3^2\cdot5\cdot23, and 621=33⋅23621 = 3^3\cdot 23. Common divisors must be products of shared prime powers: min⁡(2,3)=2\min(2,3)=2 copies of 33 and min⁡(1,1)=1\min(1,1)=1 copy of 2323 (the prime 55 does not divide 621621). So the largest common divisor is 32⋅23=9⋅23=2073^2 \cdot 23 = 9 \cdot 23 = 207, matching the reduction computation. We can also verify the universal property directly: divisors of 207=9⋅23207 = 9\cdot 23 are 1,3,9,23,69,2071,3,9,23,69,207; one checks each of these does divide both 10351035 and 621621 (e.g. 69∣103569 \mid 1035 since 1035/69=151035/69=15, and 69∣62169\mid 621 since 621/69=9621/69=9), while any other common divisor of 1035,6211035,621 — say from the factorizations above, the only common divisors are exactly {1,3,9,23,69,207}\{1,3,9,23,69,207\} since these are the only products 3i23j3^i23^j with i≤2,j≤1i\le2,j\le1 — so indeed the maximum 207207 is divisible by all smaller common divisors, consistent with the Theorem.

Example 2: Finding an explicit Bezout pair for gcd⁡(101,78)\gcd(101, 78) and applying coprime cancellation. First compute the gcd:

101=1⋅78+23,78=3⋅23+9,23=2⋅9+5,9=1⋅5+4,5=1⋅4+1,4=4⋅1+0.101 = 1\cdot 78 + 23,\quad 78 = 3\cdot 23 + 9,\quad 23 = 2\cdot 9 + 5,\quad 9 = 1\cdot5+4,\quad 5=1\cdot4+1,\quad 4=4\cdot1+0.

So gcd⁡(101,78)=1\gcd(101,78)=1: they are coprime. Back-substituting (this is the extended algorithm, previewed here):

1=5−1⋅41 = 5 - 1\cdot4
=5−1⋅(9−1⋅5)=2⋅5−1⋅9= 5 - 1\cdot(9-1\cdot5) = 2\cdot5 - 1\cdot9
=2⋅(23−2⋅9)−1⋅9=2⋅23−5⋅9= 2\cdot(23-2\cdot9) - 1\cdot9 = 2\cdot23 - 5\cdot9
=2⋅23−5⋅(78−3⋅23)=17⋅23−5⋅78= 2\cdot23 - 5\cdot(78-3\cdot23) = 17\cdot23 - 5\cdot78
=17⋅(101−78)−5⋅78=17⋅101−22⋅78.= 17\cdot(101-78) - 5\cdot78 = 17\cdot101 - 22\cdot78.

Check: 17⋅101=171717\cdot101 = 1717, 22⋅78=171622\cdot78=1716, and 1717−1716=11717-1716=1. So

101⋅17+78⋅(−22)=1,101\cdot17 + 78\cdot(-22) = 1,

confirming gcd⁡(101,78)=1\gcd(101,78)=1 via Lemma property (5), with explicit x0=17,y0=−22x_0=17, y_0=-22. Now apply the coprime cancellation property (6): suppose we are told 101∣78c101 \mid 78c for some integer cc. Since gcd⁡(101,78)=1\gcd(101,78)=1, property (6) with a=101,b=78a=101, b=78 gives 101∣c101 \mid c. Concretely, take c=101kc = 101k for any integer kk; then 78c=78⋅101k78c = 78\cdot101k, and indeed 101∣78c101 \mid 78c while also 101∣c101\mid c, consistent with (and not contradicting) the claim — the content of (6) is that no other cc can satisfy 101∣78c101\mid 78c, which one can also verify from the Bezout identity directly: multiplying 17⋅101−22⋅78=117\cdot101 - 22\cdot78 = 1 by cc gives 17⋅101c−22⋅78c=c17\cdot101c - 22\cdot 78c = c, and since 101101 divides both terms on the left (the first obviously, the second because 101∣78c101\mid 78c by hypothesis), 101∣c101 \mid c.

CounterexampleWhy "not both zero" cannot be dropped

Drop the hypothesis that a,ba,b are not both zero, and consider a=b=0a=b=0. Every integer cc satisfies c∣0c \mid 0 (since 0=c⋅00 = c\cdot 0), so the set of common divisors of 00 and 00 is all of Z\mathbb{Z}, which has no largest element and no positive element divisible by every other positive integer. Concretely: is there a positive integer dd such that every integer divides dd? No — for any candidate d>0d>0, the integer d+1d+1 is also a common divisor of (0,0)(0,0), yet d+1∤dd+1 \nmid d. So the universal property (3) in the definition is unsatisfiable, and gcd⁡(0,0)\gcd(0,0) genuinely does not exist; it is not merely a convention we could fix by picking "the largest," because there is no largest. This shows the hypothesis "not both zero" in the Theorem is essential, not a technicality: the Well-Ordering argument in Step 1 of the proof used it exactly to guarantee S≠∅S \ne \emptyset.

Scope, edge cases & common traps

SituationWhat happensCorrect statement
a=0,b≠0a=0, b\ne0gcd⁡(0,b)=∣b∣\gcd(0,b)=\lvert b\rvertEvery integer divides 00; the common divisors of 0,b0,b are exactly the divisors of bb, whose max is ∣b∣\lvert b\rvert.
a=b=0a=b=0UndefinedNo largest common divisor exists (Counterexample above).
a,ba,b negativegcd⁡(a,b)=gcd⁡(∣a∣,∣b∣)\gcd(a,b)=\gcd(\lvert a\rvert,\lvert b\rvert)Sign invariance (Lemma, part 2); gcd is always taken ≥0\ge 0.
gcd⁡(a,b)=1\gcd(a,b)=1 but neither aa nor bb is ±1\pm1Perfectly normalE.g. gcd⁡(8,15)=1\gcd(8,15)=1; coprimality is about shared factors, not about either number being a unit.
Confusing "gcd⁡(a,b)=1\gcd(a,b)=1" with "a,ba,b prime"Common student errorCoprimality is a property of the pair; 8=238=2^3 and 15=3⋅515=3\cdot5 are both composite yet coprime.

The mathematician behind it

Origins · 1 minEuclid of Alexandria and how this was discovered
EO
Euclid of Alexandria
fl. c. 300 BCE · Hellenistic Alexandria, Ptolemaic Egypt

Euclid compiled and systematized geometry and number theory in his Elements, a work whose axiomatic method shaped all of subsequent mathematics. Book VII of the Elements contains what is now called the Euclidean Algorithm for finding the greatest common measure (μέγιστον κοινὸν μέτρον) of two magnitudes — the ancestor of the modern gcd, originally phrased geometrically via repeated subtraction of line segments rather than via the division algorithm's quotient-remainder form used in modern textbooks.

History
- c. 300 BCE — Euclid's Elements, Book VII, Propositions 1–2, gives the antenaireisis (repeated subtraction) procedure for the greatest common measure of two magnitudes.
- 628 CE — Brahmagupta develops systematic rules for integer arithmetic in India, including methods later connected to linear Diophantine solvability.
- 1621 — Claude Gaspard Bachet de Méziriac publishes a Latin edition of Diophantus and separately treats integer solutions of ax+by=cax+by=c, prefiguring Bezout's identity in the Western tradition.
- 1770s — Étienne Bézout formalizes and generalizes the integer-combination identity for polynomials and integers, giving the result its modern name.
- 1801 — Carl Friedrich Gauss, in Disquisitiones Arithmeticae, systematizes gcd and coprimality as foundational tools for congruences, cementing the modern algebraic treatment used in this article.
Why is gcd⁡(0,0)\gcd(0,0) undefined instead of being defined as 00?

Some conventions do set gcd⁡(0,0)=0\gcd(0,0)=0 by declaring it to be the largest element in the divisibility partial order (since every integer divides 00, and 00 is "above" everything divisibility-wise, so it is the top element, not the largest numerically). This article uses the stricter classical convention requiring d>0d>0 to be an actual maximum under ≤\leq, which fails for (0,0)(0,0) because there is no numerically largest common divisor (every positive integer is a common divisor). Both conventions are used in the literature; what is essential is that the "not both zero" hypothesis is needed for the numerical maximum characterization to make sense, as the Counterexample block demonstrates directly.

Is gcd⁡(a,b)\gcd(a,b) always positive?

Yes, by definition, whenever a,ba,b are not both zero. Even if aa and bb are both negative, gcd⁡(a,b)\gcd(a,b) is defined to be a positive integer, because divisibility is insensitive to sign (c∣a  ⟺  c∣−ac\mid a \iff c \mid -a), and the definition explicitly requires d>0d>0. For instance gcd⁡(−18,−24)=gcd⁡(18,24)=6\gcd(-18,-24) = \gcd(18,24) = 6, not −6-6. This convention keeps gcd well-defined as a single canonical representative rather than a pair ±d\pm d.

How is gcd related to least common multiple?

For positive integers a,ba,b, the identity gcd⁡(a,b)⋅lcm(a,b)=ab\gcd(a,b)\cdot\mathrm{lcm}(a,b) = ab holds. This can be proven directly from prime factorizations: if a=∏piαia=\prod p_i^{\alpha_i} and b=∏piβib=\prod p_i^{\beta_i}, then gcd⁡(a,b)=∏pimin⁡(αi,βi)\gcd(a,b)=\prod p_i^{\min(\alpha_i,\beta_i)} and lcm(a,b)=∏pimax⁡(αi,βi)\mathrm{lcm}(a,b)=\prod p_i^{\max(\alpha_i,\beta_i)}, and since min⁡(αi,βi)+max⁡(αi,βi)=αi+βi\min(\alpha_i,\beta_i)+\max(\alpha_i,\beta_i)=\alpha_i+\beta_i for every prime, multiplying gives abab. This relation lets one compute lcm quickly once gcd is known via the Euclidean Algorithm, without factoring.

Does gcd extend to more than two integers?

Yes. For integers a1,…,ana_1,\dots,a_n not all zero, gcd⁡(a1,…,an)\gcd(a_1,\dots,a_n) is defined as the unique positive integer dividing all of them such that every common divisor of all of them divides it; it can be computed iteratively as gcd⁡(a1,gcd⁡(a2,…,an))\gcd(a_1,\gcd(a_2,\dots,a_n)), using the associativity-like property gcd⁡(a,gcd⁡(b,c))=gcd⁡(gcd⁡(a,b),c)\gcd(a,\gcd(b,c))=\gcd(\gcd(a,b),c), which follows from the same universal-property argument applied twice. All the theorems in this article extend to this setting essentially unchanged, replacing pairs of common divisors with nn-tuples.

What is the difference between "coprime" and "pairwise coprime" for three or more integers?

Integers a,b,ca,b,c are (jointly) coprime if gcd⁡(a,b,c)=1\gcd(a,b,c)=1, meaning no integer greater than 11 divides all three simultaneously. They are pairwise coprime if gcd⁡(a,b)=gcd⁡(b,c)=gcd⁡(a,c)=1\gcd(a,b)=\gcd(b,c)=\gcd(a,c)=1, a strictly stronger condition. For example, 6,10,156, 10, 15 satisfy gcd⁡(6,10,15)=1\gcd(6,10,15)=1 (jointly coprime) but are not pairwise coprime, since gcd⁡(6,10)=2≠1\gcd(6,10)=2\ne1. This distinction matters in applications like the Chinese Remainder Theorem, which requires the stronger pairwise condition.

Can gcd be computed without factoring into primes?

Yes, and this is one of the most important practical facts in the subject: the reduction property gcd⁡(a,b)=gcd⁡(a,b−qa)\gcd(a,b)=\gcd(a,b-qa) established in the Lemma is exactly what powers the Euclidean Algorithm, which computes gcd⁡(a,b)\gcd(a,b) using only repeated division, with no factorization required. This is dramatically faster than factoring for large numbers, which is why gcd computation (not factoring) is the practical tool used in cryptographic key generation.

Why does the proof avoid just saying "let dd be the largest common divisor" from the start?

Because existence of a largest common divisor is not obvious a priori — it requires knowing the set of common divisors is finite and nonempty, which itself uses that a,ba,b are not both zero. The proof instead builds dd from the Well-Ordering Principle applied to integer combinations, which simultaneously delivers the Bezout representation d=ax0+by0d=ax_0+by_0 used to prove the universal property. Constructing dd this way, rather than assuming it as "the biggest one," is what makes the proof non-circular and provides the Bezout identity as a free byproduct.

Before this

Where this leads