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

5,550,842
0
Published 2019-10-08
A curious pattern, approximations for pi, and prime distributions.
Help fund future projects: www.patreon.com/3blue1brown
An equally valuable form of support is to simply share some of the videos.
Special thanks to these supporters: 3b1b.co/spiral-thanks

Based on this Math Stack Exchange post:
math.stackexchange.com/questions/885879/meaning-of…

Want to learn more about rational approximations? See this Mathologer video.
   • Infinite fractions and the most irrat...  

Also, if you haven't heard of Ulam Spirals, you may enjoy this Numberphile video:
   • Prime Spirals - Numberphile  

Dirichlet's paper:
arxiv.org/pdf/0808.1408.pdf

Timestamps:
0:00 - The spiral mystery
3:35 - Non-prime spirals
6:10 - Residue classes
7:20 - Why the galactic spirals
9:30 - Euler’s totient function
10:28 - The larger scale
14:45 - Dirichlet’s theorem
20:26 - Why care?

Corrections:
18:30: In the video, I say that Dirichlet showed that the primes are equally distributed among allowable residue classes, but this is not historically accurate. (By "allowable", here, I mean a residue class whose elements are coprime to the modulus, as described in the video). What he actually showed is that the sum of the reciprocals of all primes in a given allowable residue class diverges, which proves that there are infinitely many primes in such a sequence.

Dirichlet observed this equal distribution numerically and noted this in his paper, but it wasn't until decades later that this fact was properly proved, as it required building on some of the work of Riemann in his famous 1859 paper. If I'm not mistaken, I think it wasn't until Vallée Poussin in (1899), with a version of the prime number theorem for residue classes like this, but I could be wrong there.

In many ways, this was a very silly error for me to have let through. It is true that this result was proven with heavy use of complex analysis, and in fact, it's in a complex analysis lecture that I remember first learning about it. But of course, this would have to have happened after Dirichlet because it would have to have happened after Riemann!

My apologies for the mistake. If you notice factual errors in videos that are not already mentioned in the video's description or pinned comment, don't hesitate to let me know.

Thanks to these viewers for their contributions to translations
Hebrew: Omer Tuchfeld

------------------

These animations are largely made using manim, a scrappy open-source python library: github.com/3b1b/manim

If you want to check it out, I feel compelled to warn you that it's not the most well-documented tool, and it has many other quirks you might expect in a library someone wrote with only their own use in mind.

Music by Vincent Rubinetti.
Download the music on Bandcamp:
vincerubinetti.bandcamp.com/album/the-music-of-3bl…

Stream the music on Spotify:
open.spotify.com/album/1dVyjwS8FBqXhRunaG5W5u

If you want to contribute translated subtitles or to help review those that have already been made by others and need approval, you can click the gear icon in the video and go to subtitles/cc, then "add subtitles/cc". I really appreciate those who do this, as it helps make the lessons accessible to more people.

------------------

3blue1brown is a channel about animating math, in all senses of the word animate. And you know the drill with YouTube, if you want to stay posted on new videos, subscribe: 3b1b.co/subscribe

Various social media stuffs:
Website: www.3blue1brown.com/
Twitter: twitter.com/3blue1brown
Reddit: www.reddit.com/r/3blue1brown
Instagram: www.instagram.com/3blue1brown_animations/
Patreon: patreon.com/3blue1brown
Facebook: www.facebook.com/3blue1brown

All Comments (21)
  • @ktu6133
    At this point, the word “beautiful” isn’t even enough to describe the sheer elegance and clarity of these videos. Amazing as always.
  • @bendahou3778
    As a maths lover, proving a theorem before you knew it existed is undeniably the best feeling I would ever experience
  • My favorite approximation for pi is 977/311 because both numbers are themselves prime and have analogous locations when typed out on a standard number pad.
  • @avimohan6594
    "I had never heard this before but I find it too delightful not to tell." This dude's love for teaching is SO OBVIOUS and deep and genuine. Every video is made with special care and I won't be surprised if he edits each lesson about 20 times before uploading to get it just right. The delight is ours, Sensei.
  • 3:22 "If you patiently went through each ray" I can hear it in your voice, thank you 3Blue1Brown for your meticulous work in counting each ray
  • @EngRMP
    OMG, mankind is so lucky to have these two things: someone who can clearly explain some of the most complex subjects in math; and a simple means of making that knowledge accessible (Youtube). I don't mean to imply that producing these videos is "simple".... no, it takes A LOT of time and effort to produce a video this wonderfully clear. Who ever thought that when Youtube started, we would get to this point... we are so lucky.
  • @rayahdesu1251
    Hello! I'm currently taking a Mathematics course in college, and I'm kind of questioning myself why did I even enter this course. This video made me realize why I love math, and why I entered a Math course in the first place. Thank you very much for these super high quality videos!
  • @SechristCircus
    Hands down one of the best "math-y" videos I've seen. One of the best concept breakdowns as well. Everything is clearly described in an easy-to-understand way, yet you don't shy from all the "overly pretentious" (lol) jargon. Finally, the call to study and understand interesting concepts ("be playful") where you may connect the dots later down the road is the best. Thank you
  • @sorio99
    I’ll be real, seeing the switch of the spiral from clockwise to counter clockwise when we move from mod 6 to mod 44 is super satisfying.
  • @aeiouaeiouaeiou
    i just thought to myself: "wow this is fascinating. i cant believe i didnt know" but then saw that i actually already liked this video. it fucking sucks to be stupid
  • "in case this is too clear for the reader" lmao Also, I absolutely love the ending. 3b1b, I wouldn't be half as enthusiastic about maths without your videos. Thanks so much!
  • @GetIntoItDuhh
    I don't even LIKE math, but this was amazing.... and I wasn't completely lost for most of the video! You're a brilliant communicator.
  • What you said toward the end about accidentally rediscovering things people learned in the past bringing an intrinsic value to them that simply being taught lacks was...completely true. It reminds me of this time once in which I tried to use multidimensional arrays to represent the possible results of a series of coinflips and accidentally discovered that the number of heads has pascal's triangle embedded into it.
  • @WobblycogsUk
    As someone who understand only a little maths it's very easy to see a diagram like that and think there's some deeper truth to it. The way you explained that there isn't was absolutely brilliant, thanks.
  • @MrHailstorm00
    Whenever I feel discouraged by humanity, I come to this channel and get courage from knowing this video still can amass millions of views
  • @umaer009
    The excitement in your voice reflects the love you've got for mathematics. Hence, your videos are truly labour of love. KEEP IT UP!
  • To begin with, I just can't even image how you even managed to make these stunning animations at such a large scale. ABSOLUTELY FANTASTIC!! Easily one of my favorite channels on YouTube.