Diophantine Equations

From Ancient Babylon to Breaking the Internet

colosieve

The 3,800-Year-Old Homework Assignment

Around 1800 BCE, a Babylonian student carved numbers into a clay tablet called Plimpton 322[^1].

It contained 15 perfect Pythagorean triples—sets of three whole numbers where:

x² + y² = z²

Examples:

  • (3, 4, 5) → 9 + 16 = 25 ✓
  • (119, 120, 169)
  • And 13 others

This is a Diophantine equation—a puzzle where you only want whole number answers.

Plimpton 322

Meet Diophantus (~250 CE)

Diophantus of Alexandria[^2] wrote Arithmetica, the first systematic treatment of these equations.

Called the “Father of Algebra”

His innovation:

  • Focused on finding solutions systematically
  • Not just verifying them
  • Introduced early algebraic notation
  • Still thought geometrically

Original puzzles:

  1. x² + y² = z² (Pythagorean triples)
  2. n(n+1)/2 = m² (Triangular numbers that are also squares)
  3. x² - y² = n (Difference of two squares)
  4. x + y = a², x - y = b² (Systems with multiple square constraints)
Diophantus

Alexandria: The Ancient Silicon Valley

Founded by Alexander the Great in 331 BCE, Alexandria became the intellectual capital of the ancient world.

Why it mattered:

  • Home to the Great Library of Alexandria (largest library in the ancient world)
  • The Mouseion (Museum) - the first research institution
  • Attracted the greatest minds: Euclid, Archimedes, Eratosthenes, and Diophantus

Location:

  • Mediterranean coast of Egypt
  • Strategic position between Europe, Africa, and Asia
  • Perfect hub for trade and ideas

For 600+ years, Alexandria was where mathematics, astronomy, medicine, and philosophy flourished.

Alexander the Great Map of Egypt showing Alexandria

Caliph Omar and Alexandria

Umar ibn al-Khattab (Omar) was the second Caliph of Islam, ruling from 634-644 CE.

What’s a Caliph? A Caliph (خليفة, “successor”) is the political and religious leader of the Islamic community after Prophet Muhammad.

The first Caliph was Abu Bakr (632-634 CE), Muhammad’s close companion.

Conquest of Alexandria: Omar’s general Amr ibn al-As conquered Alexandria in 641-642 CE, bringing Egypt into the Islamic empire.

The Library Myth: A popular legend claims Omar ordered the Great Library burned. This is a myth invented 500+ years later—no contemporary sources support it. The Library had likely already declined by then.

Umar ibn al-Khattab

From Caliph to California

From Alexandria to Spain: Not long after taking Alexandria (641-642 CE), the Islamic empire continued expanding westward…

Islamic Spain (Al-Andalus): 711-1492 CE

  • Islamic forces invaded Iberia in 711 CE (just 70 years after Alexandria)
  • Islamic rule lasted 781 years in Iberia
  • 1492: Reconquista complete - Granada falls to Catholic Monarchs
  • Spain becomes Catholic, but Arabic deeply influenced Spanish language

The Novel (1510): Just 18 years after Islamic Spain ended, Spanish author Garci Rodríguez de Montalvo wrote Las Sergas de Esplandián, featuring a mythical island called “California” ruled by Queen Calafia.

The Connection: “Calafia” likely derives from “Caliph” (خليفة) - the Islamic ruler title, still fresh in Spanish memory.

How California Got Its Name: When Spanish explorers reached the Baja California peninsula in the 1530s-1540s, they named it after the mythical island from the novel!

Legacy: Hundreds of Spanish words come from Arabic - algebra, alcohol, admiral, guitar, orange…

California flag

Why Whole Numbers Matter

Diophantine equations aren’t just math games—they show up everywhere:

Real-world constraints:

  • Commerce: Can’t buy 2.5 chickens or sell 3.7 tickets
  • Astronomy: Calendars need whole days aligned with moon cycles
  • Music: Harmonious intervals use integer ratios (Perfect fifth: 3:2, Major third: 5:4)
  • Physics: Quantum energy levels are discrete integers
  • Planets: Orbital resonances at near-integer ratios (Jupiter’s moons: 1:2:4 Laplace resonance)

When reality demands whole numbers, you need Diophantine equations.

Jupiter's moons Laplace resonance

China (~300 CE): Chinese Remainder Theorem (中国剩余定理)

From Sunzi Suanjing (孙子算经, Master Sun’s Mathematical Manual):

The problem:

有物不知其数,三三数之剩二,五五数之剩三。问物几何?

有某些东西数量不详。用3除余2,用5除余3。问是多少?

There are certain things whose number is unknown. When divided by 3, the remainder is 2; when divided by 5, the remainder is 3. What is the number?

Answer: 8 (and every number 15 apart: 8, 23, 38, 53…)

Mathematical notation:

x ≡ 2 (mod 3)
x ≡ 3 (mod 5)
→ x ≡ 8 (mod 15)

The key: If you know remainders when divided by coprime numbers, you can find the unique remainder when divided by their product.

CRT: Ancient to Modern

Ancient uses:

  • Calendar systems (coordinating solar/lunar cycles)
  • Military logistics (troop counting)
  • Astronomy (predicting planetary alignments)

Modern uses:

  • RSA cryptography (speeds up decryption by 4×!)
  • Computer arithmetic (parallel processing)
  • Clock/calendar problems

Every time you see “https://”, you’re using mathematics from 300 CE.

Calendar Systems: The Original Use Case

The Problem: Ancient astronomers needed to synchronize different celestial cycles:

  • Solar year: ~365.25 days
  • Lunar month: ~29.5 days
  • Planetary periods: Mars (687 days), Jupiter (4,333 days), Saturn (10,759 days)

The Challenge: When do these cycles align? When will the same moon phase occur on the same date?

CRT Solution: The Chinese used the Remainder Theorem to predict:

  • Eclipse cycles
  • Planetary conjunctions
  • Calendar intercalations (when to add leap months)

Example: The Metonic cycle (19 years = 235 lunar months) was discovered independently in Babylon, Greece, and China using similar remainder-based reasoning!

Modern equivalent: Your phone’s calendar handles time zones, leap years, and daylight saving - all remainder arithmetic!

Chinese Zodiac Calendar

Chinese Zodiac carvings, Kushida Shrine

Crystal Lattice: CRT in Modern Physics

Crystal lattices are periodic structures in 3D space—atoms arranged in repeating patterns.

The CRT connection:

  • Atoms repeat in different directions with different periods
  • X-direction: period = a (lattice constant)
  • Y-direction: period = b
  • Z-direction: period = c

Given diffraction data from multiple lattice planes, we need to find positions that satisfy:

x ≡ r₁ (mod a)
y ≡ r₂ (mod b)
z ≡ r₃ (mod c)

CRT solves this! Just like ancient calendar synchronization, modern physicists use CRT to:

  • Determine atomic positions from X-ray diffraction patterns
  • Index crystal planes (Miller indices)
  • Reconstruct 3D structures from 2D measurements
Praseodymium orthoscandate crystal lattice

PrScO₃ crystal (100M× magnification)

India (700-1200 CE): Pell’s Equation

Form: x² - Ny² = 1

Who solved it:

  • Brahmagupta (7th century): composition law
  • Bhāskara II (12th century): chakravala method

Why it matters: Provides rational approximations to irrational square roots!

Example for √2: Solve x² - 2y² = 1

  • (3, 2) → 3/2 = 1.5
  • (17, 12) → 17/12 ≈ 1.4167
  • (577, 408) → 577/408 ≈ 1.414215…

Fun fact: John Pell (17th c.) had nothing to do with it. Euler mistakenly attributed it to him!

Bhaskara II

Bhāskara II

Fermat Drops a Bombshell (1637)

Pierre de Fermat[^3] was reading Diophantus when he wrote in the margin:

“It is impossible to separate a cube into two cubes, or a fourth power into two fourth powers… I have discovered a truly marvelous proof of this, which this margin is too narrow to contain.”

Fermat’s Last Theorem:

xⁿ + yⁿ = zⁿ has NO integer solutions when n > 2

What we know:

  • n = 2: Infinitely many solutions
  • n = 3, 4, 5, …: Zero solutions

The problem: No one could find that “truly marvelous proof” that the margin of Diophantus’s book was supposedly just a tiny bit too small to contain — for 358 years

Pierre de Fermat

Pierre de Fermat

The Legendary Cambridge Lecture (1993)

June 1993, Isaac Newton Institute, Cambridge (UK)

Andrew Wiles[^4] announced three lectures: “Modular Forms, Elliptic Curves, and Galois Representations”

To most mathematicians, this sounded like a normal number theory topic.

Days 1 and 2: The audience of professional mathematicians listened as Wiles presented deep, technical arguments connecting elliptic curves and modular forms—difficult but not unprecedented.

Day 3, end of final lecture: Wiles calmly wrote on the blackboard:

xⁿ + yⁿ = zⁿ has no integer solutions for n > 2, FLT

Q.E.D.

The room fell completely silent… then erupted in applause and astonishment.

He had just proven Fermat’s Last Theorem—unsolved for 356 years.

Andrew Wiles

Andrew Wiles

What is Elliptic Curves

An elliptic curve is a Diophantine equation of the form:

y² = x³ + ax + b

Why Wiles needed them:

  • To prove Fermat’s Last Theorem, Wiles connected it to the Modularity Theorem for elliptic curves
  • He proved: every elliptic curve is modular
  • This indirectly proved Fermat’s equation has no solutions for n > 2

Modern impact:

  • Cryptography: ECC (Elliptic Curve Cryptography) powers Bitcoin, Signal, and modern HTTPS
  • Millennium Prize: Birch and Swinnerton-Dyer Conjecture ($1M unsolved problem about elliptic curves)
  • Theoretical Physics: String theory and mirror symmetry
Elliptic Curves

Various elliptic curves y² = x³ + ax + b

Hilbert’s Mathematical Challenge (1900)

August 8, 1900, Paris

At the International Congress of Mathematicians, David Hilbert[^5] presented a visionary lecture that would shape mathematics for the next century.

Hilbert’s 23 Problems:

  1. Continuum hypothesis
  2. Compatibility of arithmetic axioms
  3. Equality of volume of tetrahedra
  4. Line as shortest distance
  5. Lie’s concept of continuous groups
  6. Mathematical treatment of physics axioms
  7. Irrationality and transcendence
  8. Riemann hypothesis
  9. Laws of reciprocity in number fields
  10. Diophantine equations
  11. Quadratic forms with algebraic coefficients
  12. Extension of Kronecker’s theorem
  1. Impossibility of solving 7th degree equation
  2. Finite generation of invariants
  3. Schubert’s enumerative calculus
  4. Topology of algebraic curves
  5. Expression of definite forms by squares
  6. Polyhedra and space-filling
  7. Regularity of variational problems
  8. General boundary value problems
  9. Differential equations with given monodromy
  10. Uniformization by automorphic functions
  11. Calculus of variations

The impact: This list became the roadmap for 20th-century mathematics. We will come back to this list in later topics.

David Hilbert

David Hilbert

Greatest Mathematician Formalizes Greatest Physics Theory

Einstein’s Field Equations:

Rμν - ½Rgμν = (8πG/c⁴)Tμν

Hilbert’s Action (Lagrangian formulation):

S = (1/16πG) ∫ R√(-g) d⁴x

The difference:

  • Einstein: Physical intuition (F = ma style Newtonian Mechanics)
  • Hilbert: Mathematical formalism (Lagrangian mechanics)

Timeline:

  • Hilbert submitted: Nov 20, 1915
  • Einstein published: Nov 25, 1915
  • Both arrived independently
Albert Einstein Spacetime curvature

Hilbert’s 10th Problem and the Answer (1970)

Hilbert’s 10th Problem asked:

“Given any Diophantine equation… devise a process to determine whether the equation is solvable in rational integers.”

Can we write an algorithm that determines if ANY Diophantine equation has integer solutions?

Example:

  • Input: 3x² + 7xy - 5y³ = 42
  • Output: YES or NO
  • Question: Can a program answer this for every equation?

The 70-year quest: Mathematicians worked for decades trying to find such an algorithm. In 1970, Yuri Matiyasevich[^6] (building on Davis, Putnam, Robinson) proved that no such algorithm exists. Some Diophantine equations are undecidable. The halting problem can be encoded as a Diophantine equation.

Impact: Linked number theory to logic, computability, and the philosophy of mathematics

Connects to:

  • Gödel’s Incompleteness Theorems
  • Turing’s Halting Problem
  • Church-Turing thesis
Yuri Matiyasevich

Yuri Matiyasevich

Diophantine in AMC: SFFT – Simon’s Favorite Factoring Trick

For equations like: xy + ax + by = c

The trick: Add ab to both sides

xy + ax + by + ab = c + ab
(x + b)(y + a) = c + ab

Example: xy + 3x + 2y = 10

  1. Add 6: xy + 3x + 2y + 6 = 16
  2. Factor: (x + 2)(y + 3) = 16
  3. Find factor pairs of 16
  4. Solutions: (-1, 13), (0, 5), (2, 1), etc.

References