Number Theory Basics
Number theory is the study of the integers and their arithmetic structure: divisibility, primes, congruences, and Diophantine equations. Key result: every integer factors uniquely into primes (the Fundamental Theorem of Arithmetic). Applies to: cryptography, coding theory, computer science, and pure mathematics. Origins: Euclid (c. 300 BCE), systematized by Gauss in Disquisitiones Arithmeticae (1801).
The integers form a structure where addition is simple but multiplication is profound. The primes are the indecomposable building blocks under multiplication, and the Fundamental Theorem of Arithmetic says every integer is uniquely assembled from them. Most of elementary number theory flows from two engines: the division algorithm (which controls divisibility and the GCD) and modular arithmetic (which packages divisibility relations into a clean algebraic system ).
Formal Statement
For integers with , we say divides , written , if there exists an integer such that:
Derivation hint: This is a definition; the symbol asserts existence of the integer quotient . If no such integer exists, write . Here is a divisor (or factor) of , and is a multiple of . Basic properties: (reflexive on nonzero ); if and then (transitive); if and then for all (linearity).
An integer is prime if its only positive divisors are and . An integer that is not prime is composite. The number is a unit and is neither prime nor composite.
For any integers and with , there exist unique integers (quotient) and (remainder) such that:
Derivation hint: Take , the greatest integer not exceeding ; then automatically satisfies . Uniqueness follows from comparing two such representations.
Every integer can be written as a product of primes, and this representation is unique up to the order of the factors:
Derivation hint: Existence is by strong induction (split any composite into smaller factors). Uniqueness rests on Euclid's Lemma: if a prime then or .
The greatest common divisor is the largest positive integer dividing both and . Bézout's identity states there exist integers with:
Derivation hint: is the smallest positive value of the set ; minimality plus the division algorithm forces it to divide both and . Two integers are coprime (relatively prime) if .
For a positive integer , integers and are congruent modulo , written , if:
Derivation hint: Equivalently, and leave the same remainder when divided by (apply the division algorithm to each). Congruence is an equivalence relation that respects addition and multiplication, partitioning into residue classes forming the ring .
If is prime and , then:
Derivation hint: The nonzero residues are permuted by multiplication by ; multiplying them all together and cancelling the common factor yields .
If , then , where Euler's totient counts integers in coprime to :
Derivation hint: The product runs over distinct primes dividing ; it follows from being multiplicative and . The theorem generalizes Fermat's by replacing with .
If are pairwise coprime, the system has a unique solution modulo the product:
Derivation hint: Each term equals mod (since ) and vanishes mod every other (since ). Summing gives the full solution.
Why It Holds
We show no finite list of primes is complete. 1. Suppose, for contradiction, that there are only finitely many primes: . 2. Form the integer . 3. By the Fundamental Theorem of Arithmetic, has at least one prime divisor . 4. If were one of the listed primes , then , which is impossible since no prime divides . 5. Therefore is a prime not in our list — contradicting the assumption that the list was complete. 6. Hence the set of primes is infinite.
∎The algorithm repeatedly applies the division algorithm to find . 1. Given , write with (equation [2]). 2. Key lemma: . Proof: any common divisor of divides ; any common divisor of divides . The two pairs share the same divisors, hence the same greatest one. 3. Replace by and repeat. The remainders strictly decrease: . 4. Since a strictly decreasing sequence of nonnegative integers must terminate, some remainder reaches . 5. When , we have , the last nonzero remainder.
∎Gauss called mathematics "the queen of the sciences" and number theory "the queen of mathematics." At age 24 he published Disquisitiones Arithmeticae (1801), which introduced the congruence notation , systematized modular arithmetic, proved the law of quadratic reciprocity (which he called the aureum theorema, golden theorem, and proved in multiple ways throughout his life), and laid the foundations for algebraic number theory. His insistence on rigorous proof transformed number theory from a collection of clever observations into a coherent discipline. He reputedly remarked that he discovered the prime-counting estimate as a teenager.
Building Intuition
Think of the primes as a periodic table of integers: every number is a unique molecule built from prime atoms. The exponents in the prime factorization [3] are coordinates locating each integer in an infinite-dimensional grid (one axis per prime). Divisibility then means 's coordinates are all 's, coordinate-by-coordinate — the GCD takes the minimum exponent in each slot, the LCM takes the maximum. Modular arithmetic, meanwhile, is just clock arithmetic: on a 12-hour clock, because . The Chinese Remainder Theorem says that knowing the time on several coprime clocks (mod 7, mod 11, mod 13) pins down the absolute "time" uniquely up to the product .
Worked Examples
Given: Solve .
Step 1 — Find the inverse of 17 mod 43. Apply the Euclidean algorithm:
- , so (an inverse exists).
Step 2 — Back-substitute (Bézout, equation [4]):
- .
So , giving .
Step 3 — Multiply both sides by the inverse:
Check: , so . ✓
Given: Compute .
Step 1 — Apply Fermat's Little Theorem (equation [6]). Since is prime and :
Step 2 — Reduce the exponent modulo 10:
Step 3 — Evaluate the residual power:
Common Misconceptions
"The number 1 is prime." It is not. Declaring prime would destroy the uniqueness in the Fundamental Theorem of Arithmetic ([3]), since you could append any number of factors of (e.g., ). The number is a unit: it has a multiplicative inverse and is excluded from the primes precisely to preserve unique factorization.
" lets you always cancel a common factor." Cancellation is only valid when the factor is coprime to the modulus. From , you may not divide by to conclude via carelessly. The correct rule: if then .
The converse of Fermat's Little Theorem fails. One might hope that for some guarantees is prime. But is composite, yet . Such are called Fermat pseudoprimes (base 2). Worse, Carmichael numbers like satisfy for every coprime to , fooling the Fermat test for all bases. This is why probabilistic primality tests use the stronger Miller–Rabin criterion.
Connections
Number theory sits at a crossroads of mathematics. The ring and the group of units are the entry point to Abstract Algebra, where the GCD's Bézout identity reappears as the theory of ideals in Principal Ideal Domains. The distribution of primes, captured by the Prime Number Theorem , links elementary number theory to Complex Analysis through the Riemann zeta function. Quadratic reciprocity opens into Algebraic Number Theory, where unique factorization is recovered for ideals when it fails for elements. Congruences and the Chinese Remainder Theorem are the computational heart of Cryptography and Coding Theory.
Real-World Applications
Historical Development
Subtleties & Limits
Many of number theory's most natural questions remain open. The Riemann Hypothesis — that all nontrivial zeros of have real part — controls the finest error term in the distribution of primes and is one of the seven Millennium Prize Problems. The Twin Prime Conjecture asserts infinitely many pairs of primes; Yitang Zhang (2013) proved bounded gaps occur infinitely often, later sharpened by the Polymath project to gaps of size , but the gap of remains unproven. Goldbach's Conjecture (every even integer is a sum of two primes) is verified to enormous bounds but unproven. The abc conjecture, deciding the structure behind additive-multiplicative interactions, has a disputed claimed proof. These show that the integers, the simplest objects in mathematics, still harbor profound mysteries.
See Also
Modular Arithmetic · Prime Number Theorem · Diophantine Equations · Quadratic Reciprocity · Continued Fractions · Euler's Totient Function · Elliptic Curves