The Integers: Divisibility, GCD, Primes
One-line statement: The integers form a system where every number factors uniquely into primes, and divisibility, the greatest common divisor (GCD), and primality are the foundational tools for studying that structure. Key result in words: Every integer greater than 1 is either prime or can be written as a product of primes in exactly one way (up to order) — the Fundamental Theorem of Arithmetic. Where it applies: Number theory, cryptography (RSA), error-correcting codes, computer algebra, scheduling/cyclic problems, music theory. Who/when: Studied since Euclid (c. 300 BCE); systematized by Gauss (1801) in Disquisitiones Arithmeticae.The integers are the whole numbers together with their negatives. Divisibility asks whether one integer fits evenly into another, and from this single relation grows the whole edifice of elementary number theory: the greatest common divisor measures the largest shared factor of two numbers, while prime numbers are the indivisible atoms from which every other integer is built. The central, almost miraculous fact is that this factorization into primes is unique — a result so fundamental it is named the Fundamental Theorem of Arithmetic. A surprising fact: although there are infinitely many primes (proved by Euclid over two thousand years ago), no one has ever found a simple formula that generates all of them, and their detailed distribution remains one of mathematics' deepest mysteries.
The Core Insight
Multiplication of integers can be "reversed" by asking what divides what. The primes are exactly the numbers that cannot be broken down further, and every integer is a unique product of primes. This means questions about integers — their common factors, their multiples, their structure — can always be reduced to questions about primes. The GCD and the Euclidean algorithm give us a fast, mechanical way to extract that shared prime content without ever having to factor.
Formal Statement
Divisibility
Let . We say divides , written , if there exists an integer such that:
Here is a divisor (or factor) of , and is a multiple of . If no such exists, we write . Note every integer divides (take ), and divides only .
The Division Algorithm
For any integers and with , there exist unique integers (the quotient) and (the remainder) such that:
Divisibility is the special case : precisely when the remainder is zero.
Greatest Common Divisor
The greatest common divisor of integers and (not both zero), written , is the largest positive integer dividing both:
If , the numbers are called coprime (or relatively prime). The companion quantity, the least common multiple, satisfies:
Prime and Composite
An integer is prime if its only positive divisors are and itself. An integer that is not prime is composite. The number is a unit — by convention neither prime nor composite. The primes begin:
Fundamental Theorem of Arithmetic
Every integer can be written as a product of primes, and this factorization is unique apart from the order of the factors:
Bézout's Identity
For any integers (not both zero), there exist integers such that:
In particular, and are coprime iff has an integer solution.
Euclid's Lemma
If a prime divides a product , then divides at least one of the factors:
Why It Holds / Derivation
Uniqueness of Prime Factorization
We prove the uniqueness half of the Fundamental Theorem; existence is a routine induction.
Step 1 — Setup. Suppose, for contradiction, some integer has two genuinely different prime factorizations. By the well-ordering principle, let be the smallest such integer:Infinitude of Primes — Euclid's Argument
Step 1. Suppose there were only finitely many primes: . Step 2. Form the number . Step 3. , so by the Fundamental Theorem it has some prime divisor . That must be one of our list, say . Step 4. Then and , so divides their difference . But no prime divides — contradiction.Therefore the list of primes can never be complete; there are infinitely many.
Euclid of Alexandria | c. 300 BCE
Euclid compiled the Elements, the most influential mathematics text in history. Books VII–IX develop number theory from scratch: the Euclidean algorithm for GCD appears as Proposition VII.2, Euclid's Lemma as VII.30, and the infinitude of primes as the celebrated IX.20. His method — proving general truths by rigorous deduction rather than checking examples — set the template for all later mathematics. Remarkably, the algorithm he describes for computing the GCD is still, in essence, the fastest practical method used by computers today, over two millennia later.
Building Intuition
Think of each integer as built from a "recipe" of prime ingredients. The number means "two pinches of 2 and one pinch of 3." With this picture:
- Divisibility is containment of recipes: means every ingredient of appears in at least as many times. because and has two 's to spare.
- GCD is the overlap of two recipes — take the minimum count of each shared prime. .
- LCM is the union — take the maximum count of each prime: .
The primes are the ingredients that cannot themselves be made from smaller ingredients. The Euclidean algorithm is a shortcut that finds the overlap without ever opening the recipe boxes — it works purely by repeated division.
The Euclidean algorithm computing gcd(48, 18) by repeated division
Worked Examples
Computing a GCD two ways
Given: Find . Method A — Prime factorization.- Shared primes with minimum exponents: .
- → stop. Last nonzero remainder is .
Both agree. We can also find the LCM via equation [4]:
Bézout coefficients via back-substitution
Given: Express as . Step 1 — Forward (Euclidean algorithm):- → .
Common Misconceptions
"1 is prime." It is not. Including as prime would destroy the uniqueness in the Fundamental Theorem, since you could insert any number of 's: . The number is a unit, sitting in its own category. "If then or ." This is true only when is prime (Euclid's Lemma). For composite it can fail. "GCD only makes sense for positive numbers." is defined for negatives too, since divisibility ignores sign; . By convention the GCD itself is taken positive.For the failed divisibility claim above, take , , :
Connections
Divisibility and the GCD are the gateway to several neighbouring areas:
- Modular Arithmetic is built directly on the Division Algorithm — remainders modulo partition into classes, and coprimality (GCD ) is exactly the condition for an element to have a multiplicative inverse mod .
- Linear Diophantine Equations have integer solutions if and only if — a direct consequence of Bézout's Identity [7].
- Rational Numbers in lowest terms are precisely fractions with ; the GCD is what "reduces" a fraction.
- Abstract Algebra and Rings generalizes to unique factorization domains, asking which other number systems preserve the Fundamental Theorem (surprisingly, not all do).
Real-World Applications
- RSA cryptography. Internet security rests on the difficulty of factoring a large composite into its two prime factors. Encryption uses GCD/coprimality conditions and modular inverses computed by the extended Euclidean algorithm.
- Reducing fractions in software. Computer algebra systems (Mathematica, SymPy) and even spreadsheet engines call the Euclidean algorithm constantly to keep rationals in lowest terms.
- Gear ratios and engineering. When two gears with and teeth mesh, the pattern repeats after teeth; choosing coprime tooth counts () spreads wear evenly — the "hunting tooth" design.
- Error-correcting codes. Cyclic redundancy checks (CRCs) and Reed–Solomon codes used in CDs, QR codes, and deep-space transmission rely on divisibility of polynomials, the exact analogue of integer divisibility.
- Cryptographic hashing & random number generators. Linear congruential generators require carefully chosen coprime parameters to achieve full period.
- Music theory. The 12-tone scale and rhythmic cycles (polyrhythms like 3-against-4) are governed by LCM and GCD of period lengths.
- Scheduling and calendars. Determining when periodic events coincide (planetary alignments, bus timetables, the Metonic cycle relating lunar and solar years) is an LCM computation.
Historical Development
- c. 300 BCE — Euclid's Elements. Books VII–IX present the Euclidean algorithm, Euclid's Lemma, and the proof that primes are infinite. The foundation is laid.
- c. 250 CE — Diophantus of Alexandria. His Arithmetica studies integer and rational solutions of equations, giving the name to "Diophantine" problems.
- c. 1000 CE — Islamic mathematicians. Ibn al-Haytham and others investigate perfect numbers and what is now called Wilson's theorem.
- 1640 — Fermat. States his "Little Theorem" and the two-squares theorem, igniting modern number theory through his famous marginal notes.
- 1742 — Goldbach's letter to Euler. Conjectures every even number is a sum of two primes — still unproven.
- 1801 — Gauss, Disquisitiones Arithmeticae. Gives the first fully rigorous statement and proof of the Fundamental Theorem of Arithmetic and systematizes congruences. Modern number theory begins.
- 1837 — Dirichlet. Proves infinitely many primes occur in every arithmetic progression with .
- 1859 — Riemann. Connects the distribution of primes to the zeros of the zeta function, formulating the Riemann Hypothesis.
- 1896 — Hadamard & de la Vallée Poussin. Independently prove the Prime Number Theorem, describing how primes thin out: roughly primes below .
Subtleties & Limits
The atoms (primes) are understood individually, but their collective behaviour hides famous unsolved problems:
- Goldbach's Conjecture (1742): Is every even integer the sum of two primes? Verified to enormous bounds by computer, still unproven.
- Twin Prime Conjecture: Are there infinitely many primes such that is also prime (; ; ; …)? Yitang Zhang's 2013 breakthrough proved infinitely many prime pairs differ by some bounded gap, but the gap-2 case remains open.
- The Riemann Hypothesis: A conjecture about the zeta function that, if true, would pin down the distribution of primes with astonishing precision. It is one of the Clay Millennium Prize Problems.
Also worth noting: unique factorization is special to and similar systems. In the ring one has — two genuinely different factorizations into irreducibles. The Fundamental Theorem is a gift, not a guarantee.