← SnapRecaps

Why do prime numbers make these spirals? | Dirichlet’s theorem and pi approximations

► 7,487,061 views ⏲ 22:20 Watch on YouTube ↗

Summary

Plotting primes in polar coordinates reveals spirals from geometry and π approximations, not primes, ultimately demonstrating Dirichlet's theorem on prime distribution among residue classes.

Executive Summary

The video explores a striking visualization—plotting integers and primes in polar coordinates—to reveal how the apparent spiral patterns arise not from primes themselves but from geometry and rational approximations of π. It shows that all integers form Archimedean spirals, and that prime-only rays correspond to residue classes modulo 6, since primes (except 2 and 3) must sit at 1 or 5 above a multiple of 6. The tightness of the spirals is tied to famous approximations like 22/7 and 355/113 for π, with step sizes near full rotations creating the illusion of straight lines. From these observations, the video introduces Dirichlet's theorem, which guarantees that primes are evenly distributed among allowed residue classes, such as last digits 1, 3, 7, and 9, each occurring about 25% of the time. Ultimately, it argues that even a playful, unimportant plot can lead to deep mathematics, making independent discovery a valuable path to understanding formal results.

Key Points

  • ▶ 0:04 The video's central pattern originated from a Math Stack Exchange question connecting prime number distribution with rational approximations of pi.
  • ▶ 0:18 Polar coordinates describe points using radius and angle, rather than the usual Cartesian (x, y) system.
  • ▶ 0:52 Polar coordinates are not unique: adding (2\pi) to the angle does not change the location described.
  • ▶ 1:01 Plotting numbers in polar coordinates—placing each number (n) at distance (n) and angle (n) radians—creates an Archimedean spiral.
  • ▶ 3:27 The dramatic prime-number spirals and rays are misleading: plotting all whole numbers shows similar, even cleaner spirals, so the pattern is not caused by primes alone.
  • ▶ 4:29 On a smaller scale, six spirals appear, whose arms correspond to numbers grouped by their remainder modulo 6 (multiples of 6, then 1, 2, 3, 4, 5 above a multiple of 6).
  • ▶ 5:04 Counting by 6 creates a spiral illusion because 6 radians is just short of a full (2\pi) turn, so each step produces a small, continuously shrinking angular offset.
  • ▶ 5:29 Only two spiral arms survive for primes because primes cannot be multiples of 6, cannot be 2 or 4 above a multiple of 6 (even), and cannot be 3 above a multiple of 6 (divisible by 3) — leaving only residues 1 and 5 mod 6.
  • ▶ 5:58 These arms are formalized as residue classes mod 6, where “residue” means remainder; each visible spiral arm corresponds to one residue class, and every prime (except 2 and 3) is 1 or 5 above a multiple of 6.
  • ▶ 7:24 44 radians is very close to 7 full turns, making 44/7 a close approximation for 2π (and 22/7 for π).
  • ▶ 8:22 Counting by multiples of 44 creates spiral arms where each arm corresponds to a residue class modulo 44.
  • ▶ 9:04 Among primes, only residue classes sharing no prime factor with 44 remain visible, leaving exactly 20 such spirals—φ(44) = 20.
  • ▶ 11:20 710 radians is almost exactly 113 full rotations, because 355/113 is a famously good approximation to pi — this is why the spiral looks so tight.

  • ▶ 12:16 With step size 710, each new point is at nearly the same angle, so sequences appear as almost straight lines; only after extreme zoom does a gentle spiral emerge, illustrating how good the approximation really is.

  • ▶ 13:40 Filtering out residues divisible by the prime factors of 710 (2, 5, 71) explains why the prime-only pattern forms clumps of 4, with some clumps missing a "tooth" — leaving 280 eligible residue classes that empirically contain primes quite evenly.

  • ▶ 14:46 Primes greater than 5 can only end in 1, 3, 7, or 9, since they cannot be even or divisible by 5.
  • ▶ 15:44 Over many primes, the last digits 1, 3, 7, and 9 each appear about 25% of the time, even though primes are a fixed sequence rather than random.
  • ▶ 17:52 Dirichlet’s theorem generalizes this: for any modulus (n), primes are evenly distributed among the residue classes coprime to (n), with each class receiving (1/\varphi(n)) of all primes up to (x).
  • ▶ 18:56 Dirichlet’s key result is that primes are equally dense across allowed residue classes—e.g., proving infinitely many primes ending in 1 by showing a quarter of all primes do—far stronger than Euclid’s infinitude.
  • ▶ 19:23 His proof relies on complex analysis, which is surprising since primes seem disconnected from continuous math; yet this method has been standard since the 19th century and remains central to modern prime research.
  • ▶ 20:18 The playful polar-coordinate plot was ultimately unimportant, but such exploration is valuable because deep math is highly connected, and rediscovering ideas independently makes formal learning feel familiar and more effective.

Video Sections

  • ▶ 0:04 Introduction and Polar Coordinates (0:04 - 1:01) - Summary: Introduces the spiral pattern and gives a quick refresher on polar coordinates.
  • ▶ 1:01 Plotting Numbers and the Prime Spirals (1:01 - 5:04) - Summary: Shows how plotting whole numbers and primes in polar coordinates creates spirals, and why the prime-only view can be misleading.
  • ▶ 5:04 The Small Scale: Why Six Spiral Arms? (5:04 - 7:11) - Summary: Explains the six small spiral arms using residue classes modulo 6 and why primes appear in only two of them.
  • ▶ 7:11 The Larger Scale: Approximating 2π with 44 (7:11 - 10:55) - Summary: Examines the 44-step pattern, the rays and gaps, and introduces coprime numbers and Euler’s totient function.
  • ▶ 10:55 Even Larger: 710 and Prime Residue Classes (10:55 - 14:38) - Summary: Looks at the 710-radian approximation, the resulting tight clumps, and which prime residue classes survive.
  • ▶ 14:38 Dirichlet’s Theorem and Last Digits (14:38 - 18:56) - Summary: Connects the observations to prime distribution by residue class, culminating in a formal statement of Dirichlet’s theorem.
  • ▶ 18:56 Proof, Play, and Closing Thoughts (18:56 - 22:20) - Summary: Covers the significance of Dirichlet’s proof, the value of playful exploration in math, and closes the video.

Exact Transcript

Load the full timestamped transcript on demand and click any time to jump in the video.