Every once in a while, I come back to these numberphile videos to just listen to James Grime talk about his numbers. It just makes me feel so happy that he exists and that he's doing something he absolutely loves. I could never do what he does, but his enthusiasm and passion is inspiring:)
Like Ulam I was bored in my Math class a while ago and eventually wrote a Java program to generate his spiral. I found it really interesting to add color based on the relationships between the primes, like twin primes, primes that are 4 apart, 6 apart, and so on.
This is amazing. I thought they were all randomly spread out. I knew you can use find out the density of primes but not find patterns such as this. Beautiful.
Ulam's Square produces the appearance of diagonal runs of primes because primes (other than 2) have to be odd and the odd numbers are restricted to a checkerboard pattern. If you run a random number comparison with that same checkerboard restriction in place (which Numberphile didn't do), then the randomized square will produce a similar appearance of diagonal runs. This is likely true for the spiral in the latter half as well, where I'd bet the "curves" come from the layout of even and odd numbers, and the "prime curves" are just artifacts of the even/odd curves. Note: While the whole even/odd checkerboard for the square is pretty obvious, I actually did bother to run some tests just to confirm it. I ran multiple tests on increasing size squares. Every test where the hits were restricted to a checkerboard resulted in the appearance of "diagonal runs" of hits.
Very interesting video. Many years ago, when taking a Number Theory course in graduate school, I mapped the integers onto a spiraling lattice and noticed that the twin primes tended to be found at the edges of the lattice. [This property of twin primes being at the edges only worked for the first few dozen twins.] I developed a crude recursive formula, but didn't have time to pursue the study. Years later, I noted that Stanislaw Ulam had discovered this and developed it at least a decade earlier. During the mid-60s, Scientific American had an article on Ulam's remarkable work.
If you Pause the video at 4:10 You would notice that the length of sides of all the spirals are odd. Therefore almost all of the corner numbers are odd, making them most likely to be prime numbers. Also note that every alternate vertical and horizontal number is even, making it almost impossible to form any vertical/horizontal prime line. Also, you cannot predict any prime number using this pattern, because we do not know when the diagonal line is going to start and end. They are just trying to force a pattern on prime numbers by arranging them in some way, but since primes themselves do not follow any pattern they break diagonals in between. Because, not only just EVEN numbers are non-primes, other ODD numbers such as multiples of 3 after 3, multiples of 5 after 5, Multiples of 7 after 7 (and so on...) are also non-primes, which breaks the diagonals in between.
Writing a number line in a hexagonal style produces some pretty interesting spirals as well. All primes fall on one of two axes, either the 1st, or 5th axis, and you can see where the multiples of inner numbers will "block" because of the patterns of every multiple of every number crossing on to either axis. -Where any multiple of any number crosses the 1st or 5 axis, there will be no prime. Also it's pretty to stare at lol. ((1-6 for the first ring, then 7-12 for the 2nd ring 13-18 for the 3rd ring. -with 7 above 1, 8 above the 2nd side, 9 above the 3rd, 10 above the 4rth side, 11 above 5, 12 over 6, 13 above 7 in the 1st column, 14 above 8 in the 2nd column .... ect.....)) You can see clearly where n mod 6 = 1, and also when n mod 6 = 5. :)
Half the diagonals have only even numbers, so only the diagonals with odd numbers have any prime numbers at all, with the exception of those that go through the number 2.
Pause the video at 4:10 You would notice that the length of sides of all the spirals are odd. Therefore almost all of the corner numbers are odd, making them most likely to be prime numbers. Also note that every alternate vertical and horizontal number is even, making it almost impossible to form any vertical/horizontal prime line.
Do "rich veins" of primes on the diagonals ever peter out? Do new ones pop into existence farther from the origin? As I mentioned in my last post, the skeleton of this pattern is a very regular network of diagonal lines, so the number of "golden lines" is quite sparse in comparison. Could these be "coincidence eruptions", like the rogue waves that sailors fear on the open ocean?
Fibonacci is literally spelled correctly in the comment. couldn't you look and see how it's spelled? also, that's not what they meant. it doesn't matter if it's prime or not, you're just going to circle it if it is.
I don't know how many fibonacci numbers are actually prime. Don't forget they blow up in size quickly, on average becoming larger by a factor of the golden ratio with every term. It would be VERY sparse very quickly as the size of the numbers grows exponentially as you get away from the origin. There may actually only be finitely many fibonacci numbers that are prime, this would not surprise me.
what if you just visualize random odd numbers on the spiral instead of all numbers for the random pattern? numbers in a spiral like this show up as a checker pattern of even and odd.
well yes you would see some rough patterns like in the video still, but you know why, because the primes end in 3's 7's and 9's! christ the more you think about the above video the more it looks like an april fools prank gone subtle
+Aviel Menter This is additional information about the patterns seen: The diagonal lines in the Ulam Spiral are the result of the pattern you get when you plot out the position of all numbers in the set "6n +/- 1". All prime numbers except for 2 and 3 are in this set ... it's the set of all odd numbers that aren't a multiple of "3". The "6n +/- 1" set makes an especially elegant pattern of diamond tiles when you seed the number spiral with "0" instead of "1". Seeding with "1" results in the same field of tiles, but with an ugly seam near the diagonal line containing the squares of all odd numbers. I'm not sure what effect seeding with "0" would have on the "rich veins" of diagonal lines.
Of course it is concentrated into diagonals, the even values would prevent any other pattern from obviously showing up well at anything other than 45 degree angle.
This and your other video inspired me to break out my TI-83 and do some programming! Unfortunately I can only plot a 94x94 spiral and it takes about 10 minutes for my poor calculator to do, but it's still pretty fun. I plan to see if the odd-only primes idea really does completely account for the diagonals.
I'd like to see the positions of the twin primes on those diagrams. Edit: Oh, and I wonder if there's a way to arrange the numbers in another dimension to create similar patterns.
The story of the Ulams spiral is written in my book of maths of high school, so I get interested, I knew I would find a video of Numberphile, and you guys told exactly the same story, but even better ! props for that my dudes
Always amazes me when many new things are discovered at unusual times in unusual circumstances. Some of the most productive work happens not through a tight academic schedule, but through simply playing, exploring, letting the mind wander etc.
I'm seeing the lines and curves where there are lots of primes, but I'm am also seeing the lines where you will never see a prime number. Like at 2:20, where there are two line gaps that seem to mark off the first quadrant, and at 7:07, with the three lines separating the 4 quadrants in the circle. What do those lines represent I wonder?
Some quadratic equations always generate even numbers or can be written in factored form, so apart from maybe 1 or 2 primes, they will only generate composites.
@3:18 I'd like to see that picture of random numbers, but with the added rule that all even numbers other than 2 are excluded. This because the picture is now also filled with horizontal and vertical stripes while in the Ulam's spiral it is by definition only possible to form stripes that are diagonal.
After seeing this I was curious about other spirally shapes, so I wrote a quick java program to generate a 1001x1001 grid of a rhombus shape like this: 7 ... 6 2 8 13 5 1 3 9 12 4 10 11 ...and the result is rather astounding! You can see clear horizontal lines of prime numbers (but not many vertical), some of which seem to carry on for very long without much interference. Link to picture in first reply (I think some people block comments with links in them so it's best to have it separate)
Great question. I suspect that when we're looking for one thing, we often find other stuff that is useful, even if we never find the thing we set out looking for in the first place. This is also why it's important to day-dream and doodle.
I always enjoy your videos, and have done so for quite a while now. But every time you talk about primes, I can't help but wonder what would happen in other number systems, like base 12 for example. Would there be a completely different set of primes? Would they also form these patterns? I'd love a video about this stuff!
actually there exist other number-systems with other prime-numbers. but "base 12" is not related at all. instead the idea is to introduce another "number" usually substituted by a letter, with the rule that squaring it will produce some negative number. i.e. in addition to 0,1,2,3,4,5,6,... you also have 0+i,0+2i,0+3i,0+4i,... and whatever other natural number instead of 0. (here the i denotes the square-root of a negative number in the set {-1,-2} or the half of 1 plus the square-root of a number in the set {-3,-7,-11,-19,-43,-67,-163}.) that's a 2-dimensional number-line. now find some way to wrap a 2-dimensional plane into a spiral, and we'll talk of patterns on that. :-)
Quick question: When we would make this spiral with the number base of 12 instead of our base 10 system, would there be patterns and when yes how woud they look?
It's not going to make a difference. The only thing writing a number in a different base does is change how it is written. The values are still the same, regardless of how you right it, so there will be no difference in the pattern.
I tried starting with 43 spiralling in the same direction as James numerically downwards, 43 42 41 ... 0 -1 -2 ... eventually getting an unbroken prime diagonal consisting of 22 primes with -229 at one end and -607 at the other. This implies accepting the idea of negative primes, that 13 and -13 are distinct primes, and that 1 is a prime (or at least a non-composite). If you start with 41 and go numerically upwards you get another famously long diagonal. 42 occupies a central position between the two.
I got an almost completely awesome result when I started with 43 on a square grid and spiraled in the same direction as the vid but numerically downwards as I moved outwards, getting to 0 then -1 -2 and so on. I ended up with a long unbroken prime diagonal starting with -229 in the southwest and -607 in the northeast. Though I guess this implies accepting 1 as a prime (or at least non-composite), and 13 and -13 as distinct primes. Watch this space for hex spirals.
You would really love this book. I did. Peter Plichta illustrates how the prime numbers are ordered on concentric circles numbered 1 to 24 and then 25 to 48 and so on; expanding outward like cross shaped rays of sunlight radiating outward. The guy was a genius!
Kind of frustrating! Seems like there's a pattern in how prime numbers are spaced but nobody's figured out a formula to predict them yet, and I'm sure that really clever people have been trying since Euclid's day. Then again, calculus came over 2000 years after Euclid and that opened up a whole new world of mathematical possibilities (and it's something that a high school student can grasp). Maybe, in time, we'll have a whole new way of thinking about math that will make this prime number mystery seem trivial.
maybe calculus is taught in high school because of it's myriad of uses and not because it is easy to grasp. It's one of those subject that comes straight out of philosophy so I can see why it took so long to develop properly...
There are only 2 alternatives: a conical spiral and a cylindrical one, because it's very hard to make a 1D line move like a spiral that touches all numbers inside a cube and progressively does the same thing with larger cubes using the 1st cube as the center. That's why the trivial alternatives are either a cylinder or a vortex wrapping a finite sized cube, instead of an infinite sized cube
Still not convinced by the pattern in this video. The comparison is made to random numbers, but primes are certainly odd (except 2), and all odd numbers are on diagonals. So isn't it normal we see diagonals when the picture is part of a picture with only diagonals? I'm not saying this is all false btw, but it would have been nicer to show the difference between the prime numbers and random odd numbers, instead of random numbers without any restriction.
+Sander Deryckere I saw someone do that. The same patterns don't emerge. There is something special about prime numbers. A lot of mathematicians have thought about the Ulam Spiral. If it was something as simple as it being odd numbers, it would have been discovered.
+Sander Deryckere That's a slippery road if you ask me. When you graph random odd numbers, it isn't completely random anymore : you have introduced a bias. Then why stop at eliminating numbers divisible by 2 ? Why not eliminate the numbers divisible by 3 ? Primes are never divisible by 3 so that would be a better comparison. Then why not add the numbers divisible by 5 ? And 7 ? And so on.. By eliminating more and more divisors, you'll end up with the graph of prime numbers, with the same pattern shown in this video (or at least a subset of it, keeping in mind we pick inside it at random). Surely the pattern will start to emerge somewhere along the way between complete randomness and your elimination by divisors process. Therefore some faint properties of the pattern should be visible in earlier iterations, like the graph of random odd numbers. So I think comparing to completely random numbers is more relevant.
+mens sana but it's easy to show that there's a relation between diagonals and oddness of a number. It's not the case for multiples of 3. And if you see the same pattern for whatever multiples you leave out, did you really find a pattern for prime numbers then? There are more patterns I could find for prime numbers. Like patterns in the final digit of a number (which almost never even or 5). But would you classify that as a pattern for prime numbers, or as a pattern for multiples of 2 and 5? Again, I'm not saying this video is false, and there are probably statistical methods to see if there's a pattern there or not. But as it is, it's not very convincing to me.
When you created the noise chart visible at 3:20 , did you exclude the "even" diagonals from potential noise? And did you put in the same total amount of points in both pictures? Also on the primes sheet you see a higher density in the center than on the white noise.
Considering that regular hexagons tesselate just as well as squares, I wonder what the prime distribution would look like in a hexagonally arrayed Ulam spiral.
The dense line in the prime spiral graph from your video, is 23 bits from the center on the x axis leading to this prime dense formula: x = all even numbers.... .75*(x^2)+1.5*x + 23 = 48% prime numbers, 78% product of two prime numbers, out to 10^9 integers.
What happens if you start drawing the square at 0? I note from other comments that since the pattern is formed in part due to the relationship between primes and odd numbers, I just wondered if it made any difference whether or not you start with an odd or even number. It would change the numerical-position of each corner, and hence the 45° nature of the existing pattern. What happens if you start at -1?
Well, i think it's intuitive that they're appearing on diagonals since the spiral you made has all the odd numbers on the corners of each square as the squares spiral larger.
I wrote a ulam spiral with a hexagon with 3 axis. All of the primes appeared to be on radii with 5 and 7. I think possibly all primes are evenly divisible by 6 if you first subtract 1 or 5. Not all numbers on those radii were primes, so now I'm working on seeing if I can find a pattern with those. I thought a hex would show a pattern and it was pretty astounding.
fairly sure all primes (above 3) _are_ 5 or 1 mod 6 since: - not 0 mod because that means just divisible by 6 - not 2 or 4 mod because divisible by 2 - not 3 mod because divisible by 3
@@abugidaiguess nothing from 7 mod 6? EDIT: forgot how modular numbers work, ignore me. also, another commenter elsewhere pointed out that 6n +/- 1 is a known tool for finding primes
I have a couple of questions about these: First, I have tried the Ulam Spiral, and even tried adding on blank spaces at the start, to see if the decaying frequency of primes meant that the diagonals would fall apart. They didn't. Does that mean that the frequency transcends the typical quadratic alignment that seems to be happening between the primes and the square spiral?
3:10 Wouldn't it be better to compare the prime spiral to random ODD numbers chosen instead of ALL numbers? Odds are all diagonal from each other in this spiral so it may just be that that we're seeing.
I found the function 4x^2 + 4x + 1 when looking for ’the next higher whole number hypothenuse’, ie when I start from x=1 I get 1*1 then I add ’2*1*2+ 2^2 and get the next square as 3*3=9. I have been looking for ways to find whole number hypothenuses without looking too much at the literature and this was a bonus find (of which you know everything I dare say). We see the Pythagoras squares forming infinite spirals as we look at the geometric proofs also, right?
The story of Ulam creating this spiral really struck me because I remember in 8th grade I was stuck in a very boring something or other and drew this kind of spiral, highlighting all the primes, and then gave up deciding it wasn't anything
A similar concept I came up with while doodling in school too... Get grid paper, and do rows, draw lines through primes; they line up at various different angles
Do you think that if you were to lay out all of the possible ways to veiw the numbers laid out into prime spirals, you could somehow web together all of those planes to interlock with each other at vertices in some sort of panoramic view you could see the structure of the mathematical world ? Idk im kinda high and i cant really explain it too well but it makea sense to me.
I love his smile while talking about mathematics.
That's a person who's loving the thing he's doing.
And so proper. Makes what he does interesting.(even though I feel like a prime idiot after ) lol
James is the best.
He is very fortunate. Most people can't do their hobby as a job.
@@cube2fox Yeah, some of us are born in the wrong set of square kilometres to be doing math
“NOOMBAHS”
Every once in a while, I come back to these numberphile videos to just listen to James Grime talk about his numbers. It just makes me feel so happy that he exists and that he's doing something he absolutely loves.
I could never do what he does, but his enthusiasm and passion is inspiring:)
New primes, bigger primes, optimus primes
+Dylan Le Lerre
One day we'll find one. One day...
To find infinitely many numbers divisible only by themselves and 1 is the right of ALL sentient beings!
It isn't ment like that
James Grimes.
James Grime Smiles
Sad that he's name isn't James Prime.
Let's start a petition to make him change his name.
Magnus Seidenfaden Well, rather "Pierwszy"
+ Noel G.
No, all we have to do is define some special kind of prime and call it a "grime."
Like, maybe if it's gritty enough . . .
his*
he's number one
1:18 Ulam was bored by a lecture and was doodling. I like him.
Three years later, I still like him.
@@314rft 3 weeks later, I agree.
@@marios1861 3 weeks later (again), I also agree
@@terner1234 1 week later, I (doesnt do anything)
@@vgamerul4617 9 minutes later, I also do nothing
thank you
You’re very welcome
We've dug too deep
The matrix is being unveiled
+Felipe Palma
You don't want to meet the Architect.
+Sassymui8 Rumor is, he is a smelly neckbeard
+Sassymui8 You mean The Oracle.
+Curran Hyde we delved too greedily and too deep
Which pill will you take?
What I most like about numberphile is that they put subtitles in every single video. I really appreciate that ;D
James showing his true 'attraction' for primes
"Look at these curves."
lol
the 26th lol
@@genericusername4206 lol
That’s why the channel’s called numberphile
@@subzeroelectronics3022 I don't think you get the joke...
Like Ulam I was bored in my Math class a while ago and eventually wrote a Java program to generate his spiral. I found it really interesting to add color based on the relationships between the primes, like twin primes, primes that are 4 apart, 6 apart, and so on.
keep an eye out for brown papers on ebay... I'll put this one up some time... best thing is to follow numberphile on twitter and facebook! :)
You guys never cease to amaze me. You make even the most complex concepts in mathematics seems really easy. Keep up the great work guys :)
This is amazing.
I thought they were all randomly spread out.
I knew you can use find out the density of primes but not find patterns such as this.
Beautiful.
Ulam's Square produces the appearance of diagonal runs of primes because primes (other than 2) have to be odd and the odd numbers are restricted to a checkerboard pattern. If you run a random number comparison with that same checkerboard restriction in place (which Numberphile didn't do), then the randomized square will produce a similar appearance of diagonal runs. This is likely true for the spiral in the latter half as well, where I'd bet the "curves" come from the layout of even and odd numbers, and the "prime curves" are just artifacts of the even/odd curves.
Note: While the whole even/odd checkerboard for the square is pretty obvious, I actually did bother to run some tests just to confirm it. I ran multiple tests on increasing size squares. Every test where the hits were restricted to a checkerboard resulted in the appearance of "diagonal runs" of hits.
Very interesting video. Many years ago, when taking a Number Theory course in graduate school, I mapped the integers onto a spiraling lattice and noticed that the twin primes tended to be found at the edges of the lattice. [This property of twin primes being at the edges only worked for the first few dozen twins.] I developed a crude recursive formula, but didn't have time to pursue the study. Years later, I noted that Stanislaw Ulam had discovered this and developed it at least a decade earlier. During the mid-60s, Scientific American had an article on Ulam's remarkable work.
If you Pause the video at 4:10
You would notice that the length of sides of all the spirals are odd.
Therefore almost all of the corner numbers are odd, making them most likely to be prime numbers.
Also note that every alternate vertical and horizontal number is even, making it almost impossible to form any vertical/horizontal prime line.
Also, you cannot predict any prime number using this pattern, because we do not know when the diagonal line is going to start and end.
They are just trying to force a pattern on prime numbers by arranging them in some way, but since primes themselves do not follow any pattern they break diagonals in between. Because, not only just EVEN numbers are non-primes, other ODD numbers such as multiples of 3 after 3, multiples of 5 after 5, Multiples of 7 after 7 (and so on...) are also non-primes, which breaks the diagonals in between.
Nice thinking!
Writing a number line in a hexagonal style produces some pretty interesting spirals as well. All primes fall on one of two axes, either the 1st, or 5th axis, and you can see where the multiples of inner numbers will "block" because of the patterns of every multiple of every number crossing on to either axis. -Where any multiple of any number crosses the 1st or 5 axis, there will be no prime. Also it's pretty to stare at lol. ((1-6 for the first ring, then 7-12 for the 2nd ring 13-18 for the 3rd ring. -with 7 above 1, 8 above the 2nd side, 9 above the 3rd, 10 above the 4rth side, 11 above 5, 12 over 6, 13 above 7 in the 1st column, 14 above 8 in the 2nd column .... ect.....)) You can see clearly where n mod 6 = 1, and also when n mod 6 = 5. :)
Thank you Dr. Grime and Brady for bringing us these videos. By the way, Dr. Grime you are my favorite.
Half the diagonals have only even numbers, so only the diagonals with odd numbers have any prime numbers at all, with the exception of those that go through the number 2.
Pause the video at 4:10
You would notice that the length of sides of all the spirals are odd.
Therefore almost all of the corner numbers are odd, making them most likely to be prime numbers.
Also note that every alternate vertical and horizontal number is even, making it almost impossible to form any vertical/horizontal prime line.
would using a different base reveal a pattern to? perhaps even clearer?
Would a different base change the design? Primes come in the same order in all bases, or so I believe.
bases dont matter? primes are number that are defined using other numbers, none of which has anything to do with bases
You've got to love that ViHart reference😜
ViHart FTW
TH-cam *DID NOT EXIST* back then. LOL
Was great reference
oh yeah. I heard "Ulam" and was like, "now where have I heard of him before"
@@firefish111 LOL
3:14 (PI!!!) are those random odd integers with natural log variance?? or just random pick of all pos. integers?
I would guess probably the same variance as the average gap between the primes which as you Said is approximately log n
Bengt Bengt we guess but we dont know what he did :(
nope :)
I like this guy, he's really excited about the primes
Do "rich veins" of primes on the diagonals ever peter out? Do new ones pop into existence farther from the origin? As I mentioned in my last post, the skeleton of this pattern is a very regular network of diagonal lines, so the number of "golden lines" is quite sparse in comparison. Could these be "coincidence eruptions", like the rogue waves that sailors fear on the open ocean?
+Len Arends Thats a really interesting question. thanks.
+Len Arends One quadratic that always has a high prime density (but doesn't form one of those lines) is x^2+x+41.
Correction: Euler's formula that I mentioned does eventually get on such a line.
Is there a pattern of primes by doing the same thing for Fibonacci numbers (1,1,2,3...) instead of counting numbers (1,2,3,4...)?
No 8 is not prime but in fibanachi
Fibonacci is literally spelled correctly in the comment. couldn't you look and see how it's spelled? also, that's not what they meant. it doesn't matter if it's prime or not, you're just going to circle it if it is.
Vigo Hornblower the Fibonacci sequence is the most overrated sequence ever
@@corinth6402 Your reply is math version of r/whoosh
I don't know how many fibonacci numbers are actually prime. Don't forget they blow up in size quickly, on average becoming larger by a factor of the golden ratio with every term. It would be VERY sparse very quickly as the size of the numbers grows exponentially as you get away from the origin. There may actually only be finitely many fibonacci numbers that are prime, this would not surprise me.
what if you just visualize random odd numbers on the spiral instead of all numbers for the random pattern? numbers in a spiral like this show up as a checker pattern of even and odd.
so?
yeah and what about making a spiral from only odd numbers to see if the primes still arrive at any such patterns... well spotted guy
That's exactly what I thought
That does leave you with the awkward question of what to do with your initial prime number of 2
well yes you would see some rough patterns like in the video still, but you know why, because the primes end in 3's 7's and 9's! christ the more you think about the above video the more it looks like an april fools prank gone subtle
What happens when you make an Ulam Spiral in 3d rather than 2d?
piynubbunyip 2 yrs but anyway imagine in what direction should it go.
wo997 +1 more yrs, there is no way to make a spiral in 3d with counting numbers being next to each other in a formatted pattern.
There's then another dimension of posibilities of patterns when doing so
Well you could make an helix
You get an Ulam Meatball
I don't even see the code, all I see is blonde, brunette, redhead...
What a reference. What a film.
lol
I mean....props for this
"Look at these cuuuurves" :D
I love how this is used for once in a nonsexual way
sometimes i go back to videos on this channel because it's always fun, and... wow. i didn't remember vihart getting a mention here 10 years ago.
What happens if you do an ulam spiral, but instead of circling primes, you circle random odd numbers with logarithmic spacing?
+TheFizzyKerbal That was my first thought: oddity would be enough to explain that pattern?
+Aviel Menter ok
+Augusto De Nardin ok
+Aviel Menter This is additional information about the patterns seen:
The diagonal lines in the Ulam Spiral are the result of the pattern you get when you plot out the position of all numbers in the set "6n +/- 1". All prime numbers except for 2 and 3 are in this set ... it's the set of all odd numbers that aren't a multiple of "3".
The "6n +/- 1" set makes an especially elegant pattern of diamond tiles when you seed the number spiral with "0" instead of "1". Seeding with "1" results in the same field of tiles, but with an ugly seam near the diagonal line containing the squares of all odd numbers. I'm not sure what effect seeding with "0" would have on the "rich veins" of diagonal lines.
Christopher Night Thank you!
Of course it is concentrated into diagonals, the even values would prevent any other pattern from obviously showing up well at anything other than 45 degree angle.
Clinton Johnson but some diagonals have more primes than others all diagonals only contain odd numbers but not all have as many primes as each other
David Steere Exactly. It's not that they're concentrated into diagonals. They are concentrated at CERTAIN diagonals, which is the point to begin with.
This and your other video inspired me to break out my TI-83 and do some programming! Unfortunately I can only plot a 94x94 spiral and it takes about 10 minutes for my poor calculator to do, but it's still pretty fun. I plan to see if the odd-only primes idea really does completely account for the diagonals.
Seriously Brady, thank you so much for this channel. I love it.
I'd like to see the positions of the twin primes on those diagrams. Edit: Oh, and I wonder if there's a way to arrange the numbers in another dimension to create similar patterns.
Yea.. I was thinking the fibonacci spiral...
The story of the Ulams spiral is written in my book of maths of high school, so I get interested,
I knew I would find a video of Numberphile, and you guys told exactly the same story, but even better ! props for that my dudes
Curious if there are any other types of spirals that show other interesting patterns when filled in with primes
Always amazes me when many new things are discovered at unusual times in unusual circumstances. Some of the most productive work happens not through a tight academic schedule, but through simply playing, exploring, letting the mind wander etc.
The Sacks Spiral looks like iron filings on paper over a magnet.
Brady, you are a legend
very cool.
very cool comment.
very cool reply.
very cool minds of math we all have...
I'm seeing the lines and curves where there are lots of primes, but I'm am also seeing the lines where you will never see a prime number. Like at 2:20, where there are two line gaps that seem to mark off the first quadrant, and at 7:07, with the three lines separating the 4 quadrants in the circle. What do those lines represent I wonder?
Some quadratic equations always generate even numbers or can be written in factored form, so apart from maybe 1 or 2 primes, they will only generate composites.
1:24 ViHart reference!!! "Triangle!"
@3:18
I'd like to see that picture of random numbers, but with the added rule that all even numbers other than 2 are excluded. This because the picture is now also filled with horizontal and vertical stripes while in the Ulam's spiral it is by definition only possible to form stripes that are diagonal.
0:58 - Kudos for pronouncing Stanisław right, with "ł" not "l".
@᪶ ᪶ Polish "ł" is very close to English "w" in "we" or "wet". Polish "w" sounds like English "v".
Whoa, that 4x^2 - 2x + 1 works for x = -1 as well, you start getting the other end of the diagonal. I wasn't expecting that.
After seeing this I was curious about other spirally shapes, so I wrote a quick java program to generate a 1001x1001 grid of a rhombus shape like this:
7
... 6 2 8
13 5 1 3 9
12 4 10
11
...and the result is rather astounding! You can see clear horizontal lines of prime numbers (but not many vertical), some of which seem to carry on for very long without much interference. Link to picture in first reply (I think some people block comments with links in them so it's best to have it separate)
Great question. I suspect that when we're looking for one thing, we often find other stuff that is useful, even if we never find the thing we set out looking for in the first place. This is also why it's important to day-dream and doodle.
Brady can you ask them if the
i love this channel, amazingly simple and pleasant to watch.
7:06
This is how Death Star was invented.
i thought it was a basketball
That movie would've sucked then LOL :p
Oh thank god I thought I was gonna have to say it
I always enjoy your videos, and have done so for quite a while now. But every time you talk about primes, I can't help but wonder what would happen in other number systems, like base 12 for example. Would there be a completely different set of primes? Would they also form these patterns?
I'd love a video about this stuff!
actually there exist other number-systems with other prime-numbers. but
"base 12" is not related at all. instead the idea is to introduce
another "number" usually substituted by a letter, with the rule that
squaring it will produce some negative number. i.e. in addition to
0,1,2,3,4,5,6,... you also have 0+i,0+2i,0+3i,0+4i,... and whatever
other natural number instead of 0. (here the i denotes the square-root
of a negative number in the set {-1,-2} or the half of 1 plus the square-root of a number in the set {-3,-7,-11,-19,-43,-67,-163}.)
that's a 2-dimensional number-line. now find some way to wrap a
2-dimensional plane into a spiral, and we'll talk of patterns on that.
:-)
Amazing! And 7:00 looks like a basketball!
Ace Diamond lol. I initially thought that it looked like the Death Star
thanks
Quick question: When we would make this spiral with the number base of 12 instead of our base 10 system, would there be patterns and when yes how woud they look?
I'm really interested if those patterns are connected to the way the universe is or only to the way our base 10 counting system is
Magnus exactly what I thought.
George Lubomirov When I get time I'm going to make a base 12 spiral and post it here for you
It's not going to make a difference. The only thing writing a number in a different base does is change how it is written. The values are still the same, regardless of how you right it, so there will be no difference in the pattern.
Yeah, after a bit of googling I understood that :)
Have you read Douglas Adams books? Try making Ulam spiral starting with 42 (which is "the meaning of life")...
I tried starting with 43 spiralling in the same direction as James numerically downwards, 43 42 41 ... 0 -1 -2 ... eventually getting an unbroken prime diagonal consisting of 22 primes with -229 at one end and -607 at the other. This implies accepting the idea of negative primes, that 13 and -13 are distinct primes, and that 1 is a prime (or at least a non-composite). If you start with 41 and go numerically upwards you get another famously long diagonal. 42 occupies a central position between the two.
what if you use a hexagonal spiral, or not a spiral at all, what if you add in negative numbers?
I got an almost completely awesome result when I started with 43 on a square grid and spiraled in the same direction as the vid but numerically downwards as I moved outwards, getting to 0 then -1 -2 and so on. I ended up with a long unbroken prime diagonal starting with -229 in the southwest and -607 in the northeast. Though I guess this implies accepting 1 as a prime (or at least non-composite), and 13 and -13 as distinct primes. Watch this space for hex spirals.
what does it look like if you randomly pick numbers only ending in 1, 3, 7 or 9?
***** shoutout @1:23;) Well done.
Omg primes are like busses, I like that a lot.
How to make a great mathematical discovery: doodle in math class
You would really love this book. I did. Peter Plichta illustrates how the prime numbers are ordered on concentric circles numbered 1 to 24 and then 25 to 48 and so on; expanding outward like cross shaped rays of sunlight radiating outward. The guy was a genius!
Watching this after seeing the 3b1b s' new upload
Yep, me too
🙃
1:17 I love how happy he is while saying “very boring lecture”.
Kind of frustrating! Seems like there's a pattern in how prime numbers are spaced but nobody's figured out a formula to predict them yet, and I'm sure that really clever people have been trying since Euclid's day.
Then again, calculus came over 2000 years after Euclid and that opened up a whole new world of mathematical possibilities (and it's something that a high school student can grasp). Maybe, in time, we'll have a whole new way of thinking about math that will make this prime number mystery seem trivial.
maybe calculus is taught in high school because of it's myriad of uses and not because it is easy to grasp. It's one of those subject that comes straight out of philosophy so I can see why it took so long to develop properly...
The opening of this was beautifully edited. It was cut off perfectly.
Hi, there, is there anyone who tried to arrange numbers into a three dimensional cube, instead of a two-dimensional square?
How exactly would you do that?
There are only 2 alternatives: a conical spiral and a cylindrical one, because it's very hard to make a 1D line move like a spiral that touches all numbers inside a cube and progressively does the same thing with larger cubes using the 1st cube as the center. That's why the trivial alternatives are either a cylinder or a vortex wrapping a finite sized cube, instead of an infinite sized cube
I literally watched this video at the same time the follow up vid was posted. It was a rather pleasant surprise.
Still not convinced by the pattern in this video. The comparison is made to random numbers, but primes are certainly odd (except 2), and all odd numbers are on diagonals. So isn't it normal we see diagonals when the picture is part of a picture with only diagonals?
I'm not saying this is all false btw, but it would have been nicer to show the difference between the prime numbers and random odd numbers, instead of random numbers without any restriction.
+Sander Deryckere I saw someone do that. The same patterns don't emerge. There is something special about prime numbers. A lot of mathematicians have thought about the Ulam Spiral. If it was something as simple as it being odd numbers, it would have been discovered.
+Houshalter As I said, I didn't claim this video to be wrong, I just claim this video to be not convincing enough as it was presented here.
+Sander Deryckere That's a slippery road if you ask me. When you graph random odd numbers, it isn't completely random anymore : you have introduced a bias.
Then why stop at eliminating numbers divisible by 2 ? Why not eliminate the numbers divisible by 3 ? Primes are never divisible by 3 so that would be a better comparison. Then why not add the numbers divisible by 5 ? And 7 ? And so on.. By eliminating more and more divisors, you'll end up with the graph of prime numbers, with the same pattern shown in this video (or at least a subset of it, keeping in mind we pick inside it at random).
Surely the pattern will start to emerge somewhere along the way between complete randomness and your elimination by divisors process. Therefore some faint properties of the pattern should be visible in earlier iterations, like the graph of random odd numbers. So I think comparing to completely random numbers is more relevant.
+mens sana but it's easy to show that there's a relation between diagonals and oddness of a number. It's not the case for multiples of 3.
And if you see the same pattern for whatever multiples you leave out, did you really find a pattern for prime numbers then?
There are more patterns I could find for prime numbers. Like patterns in the final digit of a number (which almost never even or 5). But would you classify that as a pattern for prime numbers, or as a pattern for multiples of 2 and 5?
Again, I'm not saying this video is false, and there are probably statistical methods to see if there's a pattern there or not. But as it is, it's not very convincing to me.
mens sana Randomness doesn’t implies equality distribution nor lack of any pattern , you know nothing about basic statistics.
When you created the noise chart visible at 3:20 , did you exclude the "even" diagonals from potential noise?
And did you put in the same total amount of points in both pictures?
Also on the primes sheet you see a higher density in the center than on the white noise.
Who came here after 3Blue1Brown's video?
Franz Louis Cesista yeah, just watched it
🖐
+1
Me
Not me... I searched on TH-cam for ulam spiral and this came up
At 2:49 there are visible 'anti-lines', rows and columns where no primes break up the whitespace; what are those?
7:08 Pacman ^^
you should do one and find out!!!
What would it look like if you marked out random odd numbers? I think it could be just that.
ive ventured into the deep and dark world of intense boredom
Massive Balloonknot 1.49 AM
How are prime numbers boring
Considering that regular hexagons tesselate just as well as squares, I wonder what the prime distribution would look like in a hexagonally arrayed Ulam spiral.
Let's build Prime Maps!
@Numberphile The patterns at @7:13 are very similar to potential flow lines around a horizontal flat plate!
7:06 OMG It's a death star
7 years late, but I was looking for this comment!
I'm curious what happens if you curve fit these prime lines/spirals and then look at the error distribution. Is it Gaussian?
Am I the only one who thinks this is hiding a depth so complex that we can't comprehend it and finding it creepy as hell? Yeah? Okay...
The dense line in the prime spiral graph from your video, is 23 bits from the center on the x axis leading to this prime dense formula: x = all even numbers....
.75*(x^2)+1.5*x + 23 = 48% prime numbers, 78% product of two prime numbers, out to 10^9 integers.
The plural of formala is formulAE and not formulAS!
formala is the plural of formalin.
You are gAE
Not if the world "formula" gas been absorbed in english
What happens if you start drawing the square at 0? I note from other comments that since the pattern is formed in part due to the relationship between primes and odd numbers, I just wondered if it made any difference whether or not you start with an odd or even number. It would change the numerical-position of each corner, and hence the 45° nature of the existing pattern. What happens if you start at -1?
I think its obvious that these spirals occur....
every prime is represented as 6k+(or-)1
so primes can't be everywhere unlike his "random" example..
2=6k+-1 ?
@@VikeingBlade excluding 2 and 3
if prime numbers are what's left when you remove all the patterns, could the stripes just be like areas without many patterns naturally?
mommy im scared
Well, i think it's intuitive that they're appearing on diagonals since the spiral you made has all the odd numbers on the corners of each square as the squares spiral larger.
I wrote a ulam spiral with a hexagon with 3 axis. All of the primes appeared to be on radii with 5 and 7. I think possibly all primes are evenly divisible by 6 if you first subtract 1 or 5. Not all numbers on those radii were primes, so now I'm working on seeing if I can find a pattern with those. I thought a hex would show a pattern and it was pretty astounding.
fairly sure all primes (above 3) _are_ 5 or 1 mod 6
since:
- not 0 mod because that means just divisible by 6
- not 2 or 4 mod because divisible by 2
- not 3 mod because divisible by 3
@@abugidaiguess nothing from 7 mod 6?
EDIT: forgot how modular numbers work, ignore me. also, another commenter elsewhere pointed out that 6n +/- 1 is a known tool for finding primes
i just absolutely adore this guy
I have a couple of questions about these: First, I have tried the Ulam Spiral, and even tried adding on blank spaces at the start, to see if the decaying frequency of primes meant that the diagonals would fall apart. They didn't. Does that mean that the frequency transcends the typical quadratic alignment that seems to be happening between the primes and the square spiral?
3:10 Wouldn't it be better to compare the prime spiral to random ODD numbers chosen instead of ALL numbers? Odds are all diagonal from each other in this spiral so it may just be that that we're seeing.
Amazing ! You remind me some of my discussions about prime numbers with a dear friend of mine when we were at high-school.
I found the function 4x^2 + 4x + 1 when looking for ’the next higher whole number hypothenuse’, ie when I start from x=1 I get 1*1 then I add ’2*1*2+ 2^2 and get the next square as 3*3=9. I have been looking for ways to find whole number hypothenuses without looking too much at the literature and this was a bonus find (of which you know everything I dare say). We see the Pythagoras squares forming infinite spirals as we look at the geometric proofs also, right?
The story of Ulam creating this spiral really struck me because I remember in 8th grade I was stuck in a very boring something or other and drew this kind of spiral, highlighting all the primes, and then gave up deciding it wasn't anything
A similar concept I came up with while doodling in school too...
Get grid paper, and do rows, draw lines through primes; they line up at various different angles
He looks so happy talking about these things, and I can totally relate to that.
What if you highlighted numbers which only have a single other factor which is also a prime?
Do you think that if you were to lay out all of the possible ways to veiw the numbers laid out into prime spirals, you could somehow web together all of those planes to interlock with each other at vertices in some sort of panoramic view you could see the structure of the mathematical world ? Idk im kinda high and i cant really explain it too well but it makea sense to me.
Would it work written out as a cube as well as a square?