21 ms·
Prime number patterns
- kevindication 14y agoTwo things that were non-obvious to me but made me extremely happy when they worked: panning and zooming.
- startupfounder 14y agoYeah, I zoomed as far as I could out and it worked really well. Good On Ya!
- mikegirouard 14y agoThat is a very nice touch. Good catch. It does seem to break a bit if you resize the browser after the initial render. A refresh will fix it though.
- jasondavies 14y agoThanks, it should handle resizing better now.
- olalonde 14y agoSlightly off-topic but how did you find out your site was submitted on HN?
- ChuckMcM 14y agoExactly, I'm not much of a numbers guy but this was really beautiful and when I hit the scroll wheel on my mouse and it got bigger I was "oh, now that's cool."
- Natsu 14y agoI use CAD enough that trying that was automatic. Very cool.
- olliesaunders 14y agoYou can also click the X to the top right of the title text to remove the title and blurb.
- Bullislander05 14y agoThis is extremely neat! The visual semi-patterns here are very interesting.
- J3L2404 14y agoCool way to display primes and composites. This type of thing is what lured me into programming in the first place. Graphing number theory experiments.
- Zenst 14y agoCute, though does appear to be limited by browser initialwindow size. Thing about prime numbers - ask yourself this question: Does the universe operate on base 10! Endless fun aint they.
- recursive 14y agoYou can drag the number line to the left. I'm past 1000 and haven't found the highest prime yet.
- Zenst 14y agoThank you, yip click - hold down mouse and move it left. Thats my afternoon bumped now lol
- madethemcry 14y agono not funny. the universe doesn`t care for the base. prime numbers are prime numbers regardless of the base or any other representation.
- ddt 14y agoWhat does the base have to do with anything?
- thlt 14y agoit can be eye catchy but says really nothing interesting about prime numbers nor their patterns
- nessus42 14y agoI don't know much about number theory, but I think this visualization probably provides significant intuition as to why number theory, which contains only theorems about integers, uses tons of math that is about a lot more than integers. Edit: Why would anyone down-vote this comment. Barbarians at the gates, I tell you! The only possible explanation is that the down-voters thinks that the relationship between number theory and other kinds of math is so obvious that it needs no further explication to those who are less informed. In which case, this is the pinnacle of arrogance. Or the down-voter believes that there is no such relationship between number theory and other kinds of math, in which case this is the pinnacle of ignorance. In any case, I personally found the visualization inspiring. I.e., it makes me want to learn some more.
- thlt 14y agothis chart basically includes a set of periodic curves, even though it looks nice but what does it tell you about prime numbers ? Intersected by only two curves 1 and itself ??? well, everyone knows this, no need to make a chart.
- nessus42 14y agoIt tells you that prime numbers and periodic curves might be related more than you might have thought at first blush. I.e., if you can mathematically describe and analyze this set of periodic curves, then you have also described and can analyze the prime numbers. As I mentioned, I don't know much about number theory, but I do know that it uses a lot of math that is counterintuitive at first blush. Perhaps this visualization gives us a clue as to why that is the case.
- dxbydt 14y ago>if you can mathematically describe and analyze this set of periodic curves, then you have also described and can analyze the prime numbers. Dude, no offense, you are really making stuff up. The periodicity has to to with the divisors of the composites. Every prime p has exactly 2 curves - the wave of period 1, and the wave of period p. There's nothing interesting or useful to take way from that observation. otoh, you look at a composite c - it has several divisors & each divisor d generates a curve of period d, and those curves intersect in interesting ways...though I don't see how you could mathematically analyze them to tell you anything about the primes nearby. They are mostly pretty patterns, not mathematically useful...here are 2 quite famous & useful diagrams on periodicity in primes if you are interested in that sort of thing - 1. the prime number cross - http://img841.imageshack.us/img841/1329/primenumbercross.gif http://img841.imageshack.us/img841/1329/primenumbercross.gif 2. hippocampal neurons & primes - http://www.hindawi.com/journals/amp/2011/519178/fig8/ http://www.hindawi.com/journals/amp/2011/519178/fig8/
- guard-of-terra 14y agoIt would look 2x nicer if they removed 0 ~ prime number branches and waves beginning from primes. Much easier to spot, less clutter.
- xmmx 14y agoIf they removed the wave beginning from a prime number what would the 2*prime number look like?
- recursive 14y agoIf they removed the branches between 0 and primes, and then removed branches beginning from primes, I don't think there would be anything left.
- guard-of-terra 14y agoThey should have removed 0 ~ number sections.
- supo 14y agoI didn't know that the Sieve of eratosthenes could look this good!
- craig552uk 14y ago3^n sequence looks like fractal penguins
- forinti 14y agoI think he meant "El Padrón de los Números Primos". Patrón means "boss", not "pattern".
- yeahboats 14y agoIt also means pattern. The source page also uses patrón. http://www.polprimos.com/ http://www.polprimos.com/
- forinti 14y agoI stand corrected. Never heard it used like that, but the Royal Academy confirms it: http://lema.rae.es/drae/?val=patr%C3%B3n http://lema.rae.es/drae/?val=patr%C3%B3n
- jasondavies 14y agoAh, good. The title is meant to be an homage to the original source of the idea. My Spanish is somewhat rusty so I didn't know it also meant boss. :)
- eevilspock 14y agoWhat you created is pretty boss.
- darkstalker 14y agoIt's correct, "patrón" means both "boss" and "pattern" depending on context, but the word "jefe" is more widely used as "boss"
- dredmorbius 14y agoAnd of course, it turns out that the English "pattern" is derived from French, "patron", from the sense of "a model to be imitated". http://www.etymonline.com/index.php?search=pattern http://www.etymonline.com/index.php?search=pattern
- pehrlich 14y agowow, that is very nice. Does anyone else think they notice that primes are near to highly divisible numbers?
- zipdog 14y agoI recall a successful 'highest prime' search using a system that checked numbers of the form 2^n - 1 (or something like that)
- acoster 14y agoThose are called Mersenne Primes, and are in the form 2^p - 1, where p is a prime number.
- recursive 14y agoThat does make a certain amount of intuitive sense, in rough terms. In a certain "region" of the integral number line, based on the magnitude of the contained numbers, we expect a certain total number of prime factors. It makes sense that highly composite numbers might be near by primes in order to "balance out". None of this is rigorous, but I think contains some intuition with a kernel of truth.
- alokm 14y agoIts beautiful. It has an interesting formation of an infinite coaxial cones. with semi vertical angles arctan(1/3), arctan(1/5), ... arctan(1/(2n-1))... (The even numbers slopes form the progression of circles on the top). Although that doesn't give the pattern of the primes, it is formed because every number has a multiple for each natural number.
- crisnoble 14y agoI had always liked the number 42. However, I must say n=48 looks a lot nicer.
- toomuchcoffee 14y agoTry touching down some place strongly composite, like 720.
- toomuchcoffee 14y agoI find this app to be quite interesting, actually. Even though it's really more a visualization of compositeness rather than of primality per se.
- dxbydt 14y agoYeah, it took me a while to sadly realize this visualization tells us nothing useful about primes. otoh, it does tell us a lot about composites. Hover on 29. The pattern is completely useless - you get one wave of period 29, and the other wave of period unity. However, hover on 28. Now you get 6 waves - of periods 1,2,4,7,14,28 - these being the divisors of 28. The intersection of these 6 waves produces those interesting floral patterns. But obviously, this whole experiment tells us much more about 28, a composite, than 29 the prime.
- toomuchcoffee 14y agoThat's just the thing. Does anyone understand the primes, really? We know a lot about number fields, multiplication and sieving... but the primes themselves (the "holes" left in the wake of the sieving process) are something of an epiphenomenon to all of this.
- ColinWright 14y agoInteresting - exact same submission - exact same URL - submitted 12 days ago: http://news.ycombinator.com/item?id=4202198 http://news.ycombinator.com/item?id=4202198 1 upvote, no discussion.
- toomuchcoffee 14y agoBut the title was much less descriptive.
- ColinWright 14y agoAgreed, but if you use a descriptive title it's likely to get changed by the mods to something less useful, simply because that's what's on the article. Indeed, this title shouldn't be allowed to stand, it should be changed to the title on the page itself, based on moderators' recent behavior. Added in edit: Oh look - downvotes for pointing out that the current HN system of finding interesting items occasionally fails.
- nessus42 14y agoIndeed the title did not stand. The title was recently changed, just as you asserted it "should" be.
- mutagen 14y agoI'd like to add tone generation so you could hear the various harmonics being added and removed as you worked up through the numbers, occasionally hitting a pure sine wave as you hit a prime number.
- jasondavies 14y agoI hadn't realised this before making it, but one interesting pattern is that the number in between twin primes is always abundant, if greater than 6. It's reasonably simple to prove using the fact that every twin prime pair except (3, 5) is of the form (6n − 1, 6n + 1).
- jjaredsimpson 14y agoAdding the fact that: perfect(x) -> abundant(nx) | n>=2 gives a proof why.
- aaronharnly 14y agoVery, very lovely. You might (or might not) also be familiar with the Ulam Spiral[1] or the arguably more beautiful Sacks Spiral[2], which do reveal certain patterns in the distribution of the primes. I used the software from this site[3] to generate a large Sacks spiral graphic, which I had custom-printed on my shower curtain. To most folks who see it, it's just some pattern of dots, but knowing the order within gives me great joy. [1] https://en.wikipedia.org/wiki/Ulam_spiral https://en.wikipedia.org/wiki/Ulam_spiral [2] http://www.numberspiral.com http://www.numberspiral.com [3] http://www.dcs.gla.ac.uk/~jhw/spirals/index.html http://www.dcs.gla.ac.uk/~jhw/spirals/index.html
- pudgereyem 14y agoThanks for the links. Math is awesome, and this kinda stuff really gets one going. No wonder some people (mathematicians) get hooked on prime numbers for the rest of their lives. It's beautiful.
- lloeki 14y agoFantastic. Fig.5 from [2] (Sacks spiral) reminded me of light cones tipping over and pointing at the singularity as one enters a black hole. [0] http://www.pitt.edu/~jdnorton/teaching/HPS_0410/chapters/black_holes/index.html#Forming http://www.pitt.edu/~jdnorton/teaching/HPS_0410/chapters/bla... [1] http://plato.stanford.edu/entries/spacetime-singularities/#GeoNatBlaHol http://plato.stanford.edu/entries/spacetime-singularities/#G...
- Confusion 14y agowhich do reveal certain patterns Perceived patterns. If an actual pattern was known, you could generate prime numbers from the pattern. No such pattern is known to exist.
- palmtree3000 14y agoIt's probabilistic, but there are patterns (lines with significantly greater prime densities than others).
- monochromatic 14y ago
- JoeCortopassi 14y agoStop it, stop it, stop it, just stop. Once an article reaches the front page, it's title is no longer editable. It causes confusion and frustration, and is obviously an issue that a lot of people dislike. I don't care about prime numbers, this article was all about the visualization to me. Every time a title gets changed like this, you are telling your user base that you don't care about what they think. I feel like I'm back in Digg, waiting for something like Reddit to pop up so I don't have to deal with the 'power' users. /rant
- macspoofing 14y agoWhat are you talking about?
- coderholic 14y agoThe title originally included something like "visualization with D3.js", which has been removed for some reason
- toomuchcoffee 14y ago...and which was why I clicked on the article in the first place. Because the title was, you know, helpful and descriptive.
- marshray 14y agoI clicked on the title "Prime Number Patterns" and am a little disappointed. I'm just not seeing any patterns other than the semicircles of increasing integer diameters. Should I stare at it longer?
- toomuchcoffee 14y agoUmm... yes, you should actually. Those patterns of semicircles aren't random, of course. They correspond directly to the degree of compositeness of the chosen modulus. Compare for n = 60,61,62, for example. The higher the totient value for n, the more circles you see, basically.
- minikrob 14y agoSimply stunning, many thanks for the link !
- wildtype 14y agoLets see how the explanation help me to solve ProjectEuler's problems.
- mayneack 14y agoThis doesn't work in IE 8
- cturner 14y agoIt's interesting that the curve on the left passes through zero rather than one. I've always been inclined to think 1x = x, and think of one as fundamental. But the pattern shows that rather than 1x being fundamental, rather there is the issue of x exists or x doesn't exist. x doesn't exist => 0. I wonder if 1*x = x is really a distraction away from a better type of thinking around existence. Also, I've always been wary of the part of the rule that says that 1 is not a prime number. Why is that?.
- brianpan 14y ago1. By definition 2. Because the math works out better If it turns out that things that depend on prime numbers work in all cases except for 1, you might as well define 1 not to be a prime number. http://en.wikipedia.org/wiki/Prime_number#Primality_of_one http://en.wikipedia.org/wiki/Prime_number#Primality_of_one
- cturner 14y ago"By definition" is a poor justification. I almost referenced the exact link you've given here. It gives poor justification for primality of one - resting on authority and lacking justification. The closest it comes (not very) is, "If 1 were admitted as a prime, these two presentations would be considered different factorizations of 15 into prime numbers, so the statement of that theorem would have to be modified." So what?
- jerf 14y ago"The closest it comes (not very) is, "If 1 were admitted as a prime, these two presentations would be considered different factorizations of 15 into prime numbers, so the statement of that theorem would have to be modified." So what?" Many proofs depend on the unique factorization of primes, many directly and many many more indirectly. It is a trivial mechanical modification to them to deal with the non-uniqueness of a prime factorization if you admit 1 as a prime number by explicitly taking that case and saying it doesn't affect this case. So in that sense, no, it's not important. Except... you've now taken numerous proofs and made them longer... and for what? There's no didactic advantage. There's no proof that is made easier by letting 1 be prime. What's the advantage of adding all these special cases? None. And that's the real reason. In the end, "by definition" is the only justification, and the reason we choose the definition is that it works the best. Unlike 0 to the power of 0 where there's at least a bit of argument to be had (though the overwhelming preponderance is for it to be 1), there's no reason to put 1 in the set of prime numbers. Even if you don't personally consider it a "lot" of evidence, it's still entirely one sided.