Why a Polar Plot of Primes Forms Spirals and Rays

A visualization connects approximations of π, residue classes and the distribution of prime numbers.

Chaîne
3Blue1Brown
Publié
8 oct. 2019
Vidéo
22:20
Lecture
3 min
Original
anglais
Ouvrir sur YouTube
En faisant défiler, la vidéo se réduit en bas à droite et continue. Les sous-titres suivent votre langue de lecture.
Langue de lectureDisponible en 2 langues
Cet article n’est pas encore disponible en français ; il s’affiche dans l’original en anglais.
RÉSUMÉ

En 30 secondes

3Blue1Brown explains why plotting each prime as both radius and angle creates spirals and rays. The discussion leads to Euler’s totient and primes in arithmetic progressions, including the video’s published correction to its historical attribution.

  1. 1Six nearly makes a turnSix radians is slightly less than 2π, producing slowly drifting arms.
  2. 2Twenty eligible classesφ(44) = 20 counts the residue classes coprime to 44.
  3. 3A close approximation355/113 approximates π, making modulo-710 classes nearly radial.
  4. 4Correcting the historyDirichlet proved infinitude in eligible classes; the stronger equal-distribution theorem came later.

À retenir

  1. The spiral geometry comes from plotting integer radians and good rational approximations of π.
  2. Filtering for primes removes most residue classes that share factors with the modulus.
  3. Euler’s totient counts the eligible coprime classes.
  4. Primes are asymptotically equally distributed among those classes for a fixed modulus.
  5. Dirichlet proved infinitude in each eligible class; the stronger asymptotic theorem was established later.
TEXTE INTÉGRAL

Lire le texte remanié, chapitre par chapitre

Transcription seule
01

Plotting primes in polar coordinates

The narrator explores a Math Stack Exchange question about a surprising plot of prime numbers. The picture connects rational approximations of π with the distribution of primes in residue classes.

The narrator explores a Math Stack Exchange question about a surprising plot of prime numbers. The picture connects rational approximations of π with the distribution of primes in residue classes.

In polar coordinates, each point has a radius r and an angle θ. The plot assigns each integer n the point (r, θ) = (n, n), with the angle measured in radians; adding a full turn to the angle does not change its direction.

As n increases, the point moves outward and rotates one radian at each step, tracing an Archimedean spiral. Keeping only primes produces apparent arms and gaps, and further zooming reveals nearly straight rays.

02

Why the spirals appear

The first surprise is that all integers produce similar spiral arms. Their geometry comes from the choice of coordinates and approximations to a full turn; primes determine which of those arms remain populated.

The first surprise is that all integers produce similar spiral arms. Their geometry comes from the choice of coordinates and approximations to a full turn; primes determine which of those arms remain populated.

Consider steps of six. Six radians is slightly less than 2π, so adding six almost returns a point to the same direction. Repeated additions drift slowly and form one visible arm.

Each arm consists of numbers with the same remainder modulo 6. Except for 2 and 3, primes can only occur in the classes 1 or 5 modulo 6; other classes are divisible by 2 or 3.

A residue class is simply a group of integers with the same remainder after division by a chosen modulus. This vocabulary lets the narrator describe each geometric arm as an arithmetic sequence.

03

Modulo 44 and the totient

At a larger scale, 44 radians is just over seven full turns because 44/7 approximates 2π, equivalently 22/7 approximates π. Each residue class modulo 44 therefore drifts only slightly in angle at each step.

At a larger scale, 44 radians is just over seven full turns because 44/7 approximates 2π, equivalently 22/7 approximates π. Each residue class modulo 44 therefore drifts only slightly in angle at each step.

Most classes modulo 44 cannot contain large primes: even residues are divisible by 2 and residues divisible by 11 share that factor with the modulus. The remaining visible classes are coprime to 44.

Euler’s totient φ(n) counts the positive integers up to n that are coprime to n. For 44, φ(44) = 20, explaining the twenty eligible arms in the example.

04

The 710-ray pattern

At a still larger scale, 710 radians is extremely close to 113 full turns. This is the same approximation as 355/113 for π, so successive points in a class modulo 710 stay nearly aligned.

At a still larger scale, 710 radians is extremely close to 113 full turns. This is the same approximation as 355/113 for π, so successive points in a class modulo 710 stay nearly aligned.

Because 710 = 2 × 5 × 71, most residue classes can be ruled out for large primes by divisibility. Removing classes divisible by 2 or 5 creates groups of four rays, while divisibility by 71 accounts for occasional gaps.

There are φ(710) = 280 coprime residue classes. Being eligible does not mean every number in a class is prime; it only removes the immediate obstruction from a common factor with 710.

05

Distribution in residue classes

To explore distribution, the narrator switches to modulo 10. Apart from 2 and 5, primes end in 1, 3, 7 or 9, corresponding to the four residue classes coprime to 10.

To explore distribution, the narrator switches to modulo 10. Apart from 2 and 5, primes end in 1, 3, 7 or 9, corresponding to the four residue classes coprime to 10.

A histogram suggests that the fraction of primes in each eligible class approaches one quarter. This is an asymptotic statement about larger and larger bounds, not a promise of equal counts in every finite interval.

More generally, the prime number theorem for arithmetic progressions says that for a fixed modulus n, primes are asymptotically equally distributed among the φ(n) residue classes coprime to n.

06

The historical correction

The video attributes that stronger equal-distribution result to Dirichlet, but its description corrects the history: Dirichlet proved the reciprocal sum diverges in each eligible class, establishing infinitely many primes there; the stronger asymptotic result was proved later.

The video attributes that stronger equal-distribution result to Dirichlet, but its description corrects the history: Dirichlet proved the reciprocal sum diverges in each eligible class, establishing infinitely many primes there; the stronger asymptotic result was proved later.

The narrator notes that complex analysis became an important tool in studying prime distributions. The video does not attempt the proof, which is substantially more involved than the visualization.

07

Why playful exploration matters

The polar plot itself is an arbitrary visualization, but exploring why it looks the way it does leads to meaningful mathematics. The narrator values this kind of play because it can make later definitions and theorems feel motivated.

The polar plot itself is an arbitrary visualization, but exploring why it looks the way it does leads to meaningful mathematics. The narrator values this kind of play because it can make later definitions and theorems feel motivated.

Sur la même chaîne

20 diapositives40:44EN
3Blue1Brown· 16 oct. 2026Grant Sanderson: There's never been a better time to go into mathGrant Sanderson, Constantin Kogler · 3Blue1BrownStudents fear AI has solved mathematics. Grant Sanderson argues the opposite: even if machines prove theorems better than we do, the institution of math stays valuable—and this is a rare moment when newcomers can reshape it.MathematicsAI for scienceHuman-AI Collaboration+2
29 diapositives51:55EN
3Blue1Brown· 18 sept. 2026The last IMO problem AI could not solveGrant Sanderson · 3Blue1BrownGrant Sanderson walks through IMO 2025 Problem 6 — a tiling puzzle that frontier models missed — and the visual patience it takes to prove a construction is optimal.MathematicsAI researchReasoning & test-time compute+2
0:55EN
3Blue1Brown· 24 juil. 2026The 64 Sugar Cubes Puzzle: Six Equal DistancesA 4×4×4 block has three colors; prove that six same-colored pairs share a distance.MathematicsEducation
33:51EN
3Blue1Brown· 16 juil. 2026What Cross-Entropy Connects: Compression, Language Models and KL DivergenceGrant Sanderson · 3Blue1BrownGrant Sanderson builds cross-entropy from code lengths and uses it to explain next-token training and distillation.MathematicsMachine LearningFoundation Models+1
Diapositives2:25EN
3Blue1Brown· 12 juin 2026How Shannon Measured the Entropy of EnglishA guessing game helped Claude Shannon estimate how much information English text contains, and why prediction is central to compression.MathematicsAI History
Diapositives1:02EN
3Blue1Brown· 10 juin 2026A Robot Walk and the Puzzle of Optimal Binary EncodingHow few bits does it take to send directions that occur with unequal frequencies?MathematicsScience Communication