# Why do prime numbers make these spirals?

Embed

- Published on Oct 8, 2019
- A story of mathematical play.

Home page: www.3blue1brown.com

Brought to you by you: 3b1b.co/spiral-thanks

Based on this Math Stack Exchange post:

math.stackexchange.com/questions/885879/meaning-of-rays-in-polar-plot-of-prime-numbers/885894

Want to learn more about rational approximations? See this Mathologer video.

ruclip.com/video/CaasbfdJdJg/video.html

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

ruclip.com/video/iFuR97YcSLM/video.html

Dirichlet's paper:

arxiv.org/pdf/0808.1408.pdf

Important error correction: 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.

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

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-3blue1brown

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 RUclip, if you want to stay posted on new videos, subscribe: 3b1b.co/subscribe

Various social media stuffs:

Website: www.3blue1brown.com

Twitter: 3blue1brown

Reddit: www.reddit.com/r/3blue1brown

Instagram: 3blue1brown_animations

Patreon: patreon.com/3blue1brown

Facebook: 3blue1brown

3Blue1BrownMonth ago^{+371}Important error correction: 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.

zcneideck9 hours agoHey Grant I love you videos and when I found a youtuber that has sectoral heterochromia i was shocked cause i have it too! The bottom 2/3 of my left eye is brown while the top 1/3 is blue (my right eye is blue as well) just thought it was awesome. Have a great day

Mohamed Clean dya20 hours agoHey guys I have a library (for sale) full of mathematics contains 3000 books in English and arranged levels added to it covers all fields of mathematics with this library contains more than 10000 research in various mathematical disciplines of the subject matter Valsalttalat with me on the following WhatsApp 212699501527

Davi Gabriel2 days agoI'm a Math Enthusiast and Student. Your video showed me how even more fascinating is Mathematics, prime numbers are some Mystery still. We don't know even a half of all the properties prime numbers show. We have a lot yet to discover, hopefully we'll get there.

Davi Gabriel2 days ago^{+1}Yeah, i heard actually Dirichlet's theorem states that there are infinitely many positive integers 'k' such that ak+b is prime, where a, b are coprime positive integers.

Lee KX3 days agoBernstein Polynomials and Bezier Curves

MrTonemasterMinute agoMandelbrot me here

artificium3 hours agoVery cool

邱心培4 hours agoSo when will you update your differential equations series video?

Just dropped in6 hours agoRUclip: simple sentence. zero dimensional space

nice name - lousy work

Bloody Bandit9 hours ago3:00 and if you zoom out, I think those gaps will turn into more spirals

Giorno Giovanna19 hours agoSPIRAL POWER; TENGEN TOPPA GURRAN LAGAAN. SPIN ON.

Mohamed Clean dya20 hours ago^{+1}Hey guys I have a library (for sale) full of mathematics contains 3000 books in English and arranged levels added to it covers all fields of mathematics with this library contains more than 10000 research paper

in various mathematical disciplines of the subject matter Valsalttalat with me on the following WhatsApp 212699501527

hj yumDay ago김종대 대답해

RishiNandhaDay agoBeautiful

IvanDay agoI DONT UNDERSTAND, IM DUMB??

Aiden ChowDay ago^{+1}hey i saw you at bmmt showcasing this video

Will ZDay ago^{+1}Saw you at BmMT this Sunday giving this lecture XD

TheCubic OneDay ago6:35 I am sorry but wtf is that way of dividing?

SagarmathaDay agoplease make a series on the z-transform and another discrete mathematics thanks

Melissa MynkzDay agoIs anyone else seeing the matrix in this!!!! (Or is it just the mushrooms I've eaten today?!?!)

Live Free2 days agoI am a poor maths student but this is stunning why couldn’t we be taught like this at school

Daniel Fernando Galindo Cañon2 days agothanx

AlexMeow bleufeline2 days ago12:40 is magical

AI Totem2 days agoYeah... I'm going to have to watch this one 10 times to get every part of it. Worth it though!

carlos der2 days agoWhy the fuck has RUclip been hidden your channel from me?

Shashank V M2 days agoI have the answer: It is because you are using polar plots.

Davi Gabriel2 days agoIf pi(x) ~ log(x) then the amount of primes smaller than x and congruent to r mod n is log(x)/phi(n) for x and n, sufficiently big.

Aditya Kumar2 days agoprimes are amazing

ganondorfchampin3 days agoSpeaking of Dirichlet, could you do something on the Dirichlet distribution?

Neil Bedwell3 days agoI wish I understoof logic/mathematical proofs

paul maydaynight3 days agoruclip.com/video/oWiYsRi2Dss/video.html

Professor Eric Laithwaite: Motors Big and Small - 1971

No Hackers3 days agoso I learned that 6k + 3 is always a factor

dittbub3 days agoDemystifying something... but actually becomes even more mystifying!

obrecht723 days ago^{+1}Great video. I always love how these fun visuals can emerge from maths.

obrecht723 days agoBy the way, am I the only one that gets a "Travel with Rick Steves" tone in the narrator's voice?

Jigsaw4 days agowould like someone to show how they calculate a non-trivial zero of the zeta function describing how they get form point A TO B.......C......? fx explainiung how the first non-trivial zero gets mapped to zero and through which mechanisms?

Alex FV4 days agoI have an undergrad in mathematics and this video really blows my mind!

suncica kovacic4 days agoJust when I think there couldnt possibly be any coordinates in the video, how the hell do you ruin even number theory with coordinate nonsense..

Sol Feinberg4 days ago3:06 the question for you and me is, "I'm sorry, what?"

mark bogacki4 days ago^{+1}Thank you

this is so nice .

Jackj106 [Karakara]4 days agoHoly shit. This is gonna have to be used in a game I make at some point in the future.

Like take a bitmap and have a working copy, where the working copy shifts it’s pixels at each prime to the previous prime, which would theoretically slowly pull the image inwards like a black hole effect. If I make a demo of this, I’ll post it as a reply to this comment :)

Rajasekhar Varri4 days agoSir are you doing videos on quantitative aptitude

pk rasel5 days agoplease,,, upload Complex number & Trigonometry video series...

EKDesign5 days agoIt would be cool to see this as 3D VR visualization

invisiblekincajou5 days agoMY BRAIN HURTS

yessirge5 days agoBeautiful video.

Al Garnier5 days agoBecause prime numbers represent the resonant frequencies of wavefunctions that create matter formation in a free electron medium.

Al Garnier5 days ago@TZero - VFX & Compositing

If you're interested, this video is a good example of the math that answers your question. It's based on wavefunctions and their resonant intercepts. The most prominent resonant positive nodes are particles of prime number exponants, while the resonant negative nodes are virtual particles.

TZero - VFX & Compositing5 days ago@Al Garnier thanks, could you please point me at some paper about this concept? especially one that relates it to prime numbers, I'm interested

Al Garnier5 days ago@TZero - VFX & Compositing

Resonant frequecies of particle wavefunctions are created by the impact of a big bang and are composed of the peaks and troughs of oscillating waves where particles of matter congeal into atoms through the effects of gravity and entropy over its lifetime.

Everything has a lifetime within a thermodynamic, gravitational field. But, not everything of matter has a conscious life function. Nothing of substance lasts forever in the "known" universe.

TZero - VFX & Compositing5 days agowhat does resonant frequencies of wavefunctions mean? mathematically

harsh vardhan dwivedi5 days ago^{+4}Can you make a video on explaining "Entropy" and its significance towards understanding physical and chemical processes

Number Number6 days agoNudge one to one general direction every so often at any interval and you get a spiral. People put their names on number patterns they thought up or noticed in things. Some people memorize them, for when it's time to talk about them.

Milad Kiaee Darunkola6 days agoawesome explanation.

Sang Jin Kim6 days ago^{+1}Great!

Gemini cash6 days agoDm me about the lottery

Francis Arthur6 days agoI haven't smoked weed in 30 years but I almost felt like it hehe

Nick 1116 days agoAnd all that most of your talk about your infinity stuff is stupid..for me at least. Sounds like I was reading your chatbot org forum again. ...sorry... but thats what it looks like to me. :)

Nick 1116 days agoAnd yeah ... U say irrational number is something which has infinte number of non repeating pattern after decimal place or wjhatever. I just say its a complex number... got some fixed(confirmed part) a plus some imaginary part 'ib'...your non repeating pattern. Infinte or not u can say actually cause u never tried upto the conclusion. So I use imaginary in general sense cause it could be anything u aint sure about cause u never explored it to end ...due to any reason...time constraint...space constraint... or even negligible effect criteria. whatever doesn't matter. So this is what it is but its still a assumption that it could be just this.

So question is not if irrational number have infinite non repeating pattern but can there be such non repeating pattern when we deal with some whole number division... sure there can be... And again I suspect your this very 1 the culprit. :)

Problem become complex when u try it on any number combo not just whole numbers... but u guys must have solved all that by now... I just havent ...that's all. Never had time for maths u know it. Ab aap phaticharo se lad lega ya math hi kar lega aadmi u c...smile

Anyway wassey bhi apan koi badey mathematic mind nahin hain... but I still am liking all this... till it does go real fuzzy or too much for me to deal with. Then u know I am gonna bail out in secs. :)

Anyway Thanks for the paper...and take care of my viku! ;)

ok ok not my..but...smile

cya

Nick 1116 days agoBtw globs I am liking your that turing book... though some of it contents remind me of your that stupid chatbot.org site rather than some truth or real problem explanation. Like they describe or approach the subjects there...Phaltu time khoti karne ke liye bana rakhi hai :)

but anyway like this book of yours...nice book...or paper whatever.

And good video here too... I kinda like this.

Nick 1116 days agoThis small fractional part creating all the problems... thats why some old wise say... u should nip the problem in budding stage or it might grow exponentially so much where u wont even recognize it with its primitivity. Ki what it was in first place.

But could happen with any number exclusion in general. So there could be trine, srine, drine any no of typical series.

Nick 1116 days agobecause of exclusion of 1 as one of divisor...nothing could be more simpler explanation I suppose! :)

Arman Shah Mansori7 days agoWhich app or apps do you use to make these animated geometrical shapes?

Dom Cailliez7 days agodumbfounds me ...awe & admiration ...i love numbers

Hien Duong Van7 days ago14:42 , Jean Pierre Polnareff?

Viktor Hahn8 days agoVery nice video, but please learn to correctly pronounce the name Dirichlet. Why are only the English speakers so arrogant to not bother with pronunciation of foreign names.

Fraisel D8 days agoSo this is the spiral power... Not bad.... not bad at all....

That One Guy8 days ago12:41

youtube compression

sexntuna8 days agoSuch a cool video! Must have taken a lot of time. Kudos!