12 ms·
An Interesting Pattern in the Prime Numbers: Parallax Compression
- toblender 8y agoIf this can really map prime numbers to a least a general region, would we be able to break Diffie-hellman key exchange more quickly? If so this could be a huge blow to security. But I must say this is amazing that they were able to visualize prime numbers in this way. These guys are geniuses.
- ssewell 8y agoI was initially thinking the same, but I don't think that's the case. This will help you find a small range of six potential primes (pick any element on the left edge of the triangle). But you're still required to calculate the factorizations on those six numbers to determine which of them are indeed prime.
- chickenstrips 8y agoNo, this won't help with finding primes. As they noted, the pattern for ranges of size k only holds for k lines. So to find a prime of length N (on the order of 2^N), we need to have k=O(2^(N/2)). However, this yields a guarantee that a prime lies in a range of size O(2^(N/2)), which is not particularly useful. We get exponentially better probabilistic results from the prime number theorem.
- felipellrocha 8y agoThis is... Amazing...!
- Invictus0 8y agoThe Ulam Spiral: https://en.m.wikipedia.org/wiki/Ulam_spiral https://en.m.wikipedia.org/wiki/Ulam_spiral
- lucb1e 8y agoDesktop link: https://en.wikipedia.org/wiki/Ulam_spiral https://en.wikipedia.org/wiki/Ulam_spiral
- tzahola 8y agoThe pattern looks nice, but I would have asked some mathematicians before announcing this as something novel.
- greggarious 8y ago>The pattern looks nice, but I would have asked some mathematicians before announcing this as something novel. The blog post serves that function.
- stormbeard 8y agoI think the invitation is extended by sharing the blog post.
- ythn 8y agoCome on, does every cool thing need a stamp of approval by "experts" before publication? "SQLite looks nice, but I would have double checked with Oracle engineers before announcing this as something novel"
- tzahola 8y agoWell, to some extent, yes. Otherwise you’d end up like the MD who’ve “rediscovered” numerical integration (the trapezoid method) and got it published in the journal of diabetes or whatever.
- codegladiator 8y agoWhat's the harm in that ?
- wuliwong 8y agoSo mathematicians should be reviewing papers in the Journal of Diabetes? I think that the Journal of Diabetes should just stay in its lane.
- tathougies 8y ago> Otherwise you’d end up like the MD who’ve “rediscovered” numerical integration (the trapezoid method) and got it published in the journal of diabetes or whatever. This was shocking because calculus is a required subject in American high schools, and this American doctor presumably went to American high school, not because the doctor didn't check in with mathematicians. Frankly, it would be equally shocking if the doctor had asked a mathematician if integration were a thing, because presumably a doctor is an educated member of society.
- aj7 8y ago“Fooled by randomness.”
- wyas 8y agoThis is awesome. How can we access the code to play around with?
- shaunxcode 8y agoIt is in an observable doc so you can fork it etc. https://beta.observablehq.com/@montyxcantsin/unwinding-the-ulam-spiral https://beta.observablehq.com/@montyxcantsin/unwinding-the-u...
- phyzome 8y agoMy gut sense is that this has something to do with visualizing the sieve of Eratosthenes, and nothing more than that. But I'd be happy to hear otherwise.
- asynchrony 8y agoOther than the sieve of Eratosthenes being a way to compute a finite list of primes I don't see the relationship here. Could you elaborate?
- ben509 8y agoI think the relationship is that the sieve has a natural shape since it's based on ruling out multiples.
- asynchrony 8y agoIsn’t the sieve’s eventual shape just the list of prime numbers?
- andrepd 8y agoI don't intent to be rude, but what does that even mean? Can you explain?
- phyzome 8y agoMostly the "pattern holding up until n^2". I don't know exactly how the groups-of-N factors into all this. Maybe it's nothing and there's no clear relationship.
- zxcb1 8y agoHow about this, but folded? https://en.m.wikipedia.org/wiki/Eisenstein_prime https://en.m.wikipedia.org/wiki/Eisenstein_prime
- airesearcher 8y agoYep - we are not claiming to be mathematicians, we're pattern hunters... this is an open invitation to others with more expertise to chime in and help figure this out... it's possible it is a minor discovery or even not a discovery... or it could be useful or even very useful. We don't know. Please help us explore it!
- cirgue 8y agoEither way, hearing a mathematician explain why this is a non-discovery would still be interesting to pretty much anyone who doesn't study primes. Kudos on a cool visualization.
- hathawsh 8y agoIf nothing else, this depiction of prime numbers looks very satisfying for recreational mathematics, much more so than the Ulam spiral. I think students who learn how to generate this pattern will be inspired to learn more about math.
- deleted 8y ago[deleted]
- proverbialbunny 8y agoIt will be interesting to see if this pattern falls apart when the numbers are reasonably large (like roughly 300 digits+).
- Someone 8y ago”we are not claiming to be mathematicians, we're pattern hunters.” “Searching for interesting tautologies” or “Hunting for patterns” are good descriptions of what mathematicians do. Mathematicians do mathematics because they want to be sure that a) they caught a pattern and b) that it is interesting. That’s what’s being discussed here.
- airesearcher 8y agoActually there is a pattern. Take a look at the Mathematica code on GitHub.
- folkstack 8y agoI wonder if there's a pattern to how many primes per cells-with-primes.
- PurpleBoxDragon 8y agoIs there are particular reasoning or meaning to each dot being 6 numbers? Is there any significant changes if you pick other numbers per dot, following the same pattern? Based on the linked explanation here: https://beta.observablehq.com/@montyxcantsin/unwinding-the-ulam-spiral https://beta.observablehq.com/@montyxcantsin/unwinding-the-u...
- ssewell 8y agoI was wondering this myself. I skimmed to the code but can't find any variable for this.
- _rpd 8y agoThe claim is that it is the same pattern independent of the number of integers per dot.
- ssewell 8y agoIf the numbers of integers-per-dot was set to 1, the sequence would simply highlight prime numbers as they progress through the pyramid shape since “Parallax Compression” would no longer apply.
- gowld 8y agoThe triangle is a hexagon folded onto itself. That's what the "parallax" part is.
- deleted 8y ago[deleted]
- clort 8y agoYet they say that this only seems valid for the number of rows equal to the number of integers-per-dot that was used. So, it would indeed highlight with reasonable certainty all the primes in the first row. (I am not a mathematician but I think that is "1" ?)
- pcmaffey 8y ago
- BicyclRepairMan 8y agoFrom a cryptography standpoint, could this hint at attack vectors for things like discrete log problems? I've only learned of the math behind that myself recently, not sure what implications having a "topographical map of the primes" could have, especially if the pattern is relf-repeating regardless of the size of the primes.
- proverbialbunny 8y agoYes, but only up to a certain point. Larger semiprimes are still a pita to get the primes out of.
- WaxProlix 8y ago> on January 18, 2018, I found a numerical sequence that generated the exact same pattern as Shaun’s pattern Does this mean that we have a sort of bloom filter-esque test for primality? (ie, it will give you a guaranteed no in O(1) but you'll have to crunch numbers to get the yes?) If so, are there implications for things that want to know "is it prime?" quickly? Crpytography comes to mind, for instance...
- pubby 8y ago>Does this mean that we have a sort of bloom filter-esque test for primality? This catches most non-primes ;) bool maybe_prime(x) { return x % 2 && x % 3 && x % 5 && x % 7; }
- std_throwaway 8y agoThis is both, correct, and useless.
- comboy 8y agoCorpos would love it.
- jdmichal 8y agoAnd it's infinitely expandable to improve accuracy, at a linear cost of computation!
- gruez 8y agoway ahead of you: https://en.wikipedia.org/wiki/Primality_test#Probabilistic_tests https://en.wikipedia.org/wiki/Primality_test#Probabilistic_t...
- enedil 8y agoWe already have quick algorithms that say "is it prime" with certainty. Reducing the required time from O(log^6(n)) to O(1) isn't particularly important from cryptographic point of view. https://en.wikipedia.org/wiki/Primality_test#Fast_deterministic_tests https://en.wikipedia.org/wiki/Primality_test#Fast_determinis...
- placebo 8y agoJust run a search on: prime numbers fractal, and many interesting articles (both academic and other) will surface. Search for: zeta function fractal, and you'll find more. I'm no mathematician but it wouldn't surprise me if two very deep fields turn out to be different "manifestations" of some deeper underlying truth, and I then wonder about the possibility of a larger grand unified theory that includes both maths and physics that would have far reaching insights which would go beyond both mathematics and physics, but then I realise that perhaps I've seen too many movies :-)
- vadansky 8y agoJust a heads up, but I would pay money for mugs/t-shirts with the pattern. Of course I can just use to code to make it myself, but it's nice to support people sometimes
- Tossrock 8y agoA few quick observations: - The right edge of the triangle is always red (ie, no primes present), because it represents (row number) * (3* (row number)+[1..6]) - Prime numbered rows are always black (except the far right column). I can sort of feel why this is true but can't express it mathematically yet.
- Recursing 8y agoIt's equivalent to http://oeis.org/A054521 http://oeis.org/A054521 Cell i of row j contains n elements of an arithmetic progression, with common difference of j. If i and j have a GCD != 1, they are not coprime, so they share a factor p, as do all numbers in the sequence, so they cannot be prime Otherwise it's very likely there's at least one prime If j is prime every column i is coprime with it, so it's going to be black
- lucb1e 8y agoThe Telegram link leads to a distribution channel, not a group, so one cannot actually discuss it there. I let the author know through the contact feature on the website, as it might be unintentional. Edit: The link was changed to a group (at the bottom of the post).
- airesearcher 8y agofixed
- md224 8y agoAwesome! It's the math enthusiast's dream to come up with something new and exciting outside of academia. Recently I discovered what I thought was an interesting chaotic map, but after posting a question about it to Math StackExchange[1] and emailing one or two professors (no response, which is understandable), my obsession waned and I gave up on trying to figure out if it had any significance. Maybe I should keep trying! [1] https://math.stackexchange.com/questions/2654984/identifying-this-chaotic-recurrence-relation https://math.stackexchange.com/questions/2654984/identifying...
- Senderman 8y agoKeep going! Don't forget: There's nothing bad about no-response - People are much more likely to respond on the web and email when you're wrong. ;)
- Mediterraneo10 8y ago> There's nothing bad about no-response - People are much more likely to respond on the web and email when you're wrong. ;) There certainly could be something bad about no-response. As someone in academia who gets uninformed musings or crackpot theories from laypeople in his mailbox from time to time, no-response basically means “I know you are wrong, seriously wrong (and, in many crackpot cases, probably mentally ill), but I am not going to just waste my time trying to tell you that.”
- dgacmu 8y agoAs someone else in academia who gets his share of crackpot emails, no response can also mean "oh god, I don't have time to think about this when I have 1000 other emails from my students and colleagues". (I'm particularly horrid at email.). So I wouldn't take it personally.
- Senderman 8y agoIt sounds to me like you should have a prewritten response for people who were interested enough to contact you, but who don't know where to start.
- kibwen 8y agoThese runes would serve excellently as a written alphabet for an alien species in fiction (or maybe for modrons or other Lawful creatures in D&D).
- brador 8y agoI'd like to see the triangle fractal as a starting state for Conways "Game of Life".
- drdeca 8y agoAs displayed in the image, every other row is offset by half a square from being on a grid. Maybe if you shifted everything to the left to line it up, but
- mar77i 8y agoWho said you couldn't have a hexagonal lattice? Instead of 8, every field has 6 neighbors. The only problem with that really is that you have to expect the 23/3 rule to look differently on that grid. So, no standard glider.
- deleted 8y ago[deleted]
- sandworm101 8y ago"It looks like something they found on the ship at Roswell."
- nautilus12 8y agoIs each row the same as if the remainder on division of the cell number by the row number is 0 then red, otherwise black?
- ehsankia 8y agoI would also like a clearer explanation of how this was generated, maybe with pseudocode, and would also like to see the larger images mentioned in the post. As it is, the explanation doesn't really make sense to me. EDIT: Found this lower down: https://beta.observablehq.com/@montyxcantsin/unwinding-the-ulam-spiral https://beta.observablehq.com/@montyxcantsin/unwinding-the-u...
- deleted 8y ago[deleted]
- crankylinuxuser 8y agoI'm noticing a few neat things about there is left-right reflected symmetry. Really neat! (I still know I haven't the math chops though. Good place to further my study)
- deleted 8y ago[deleted]
- szemet 8y agoMy take, but correct me if I'm wrong. Take the relation to the GCD triangle http://oeis.org/A054521 http://oeis.org/A054521 At GCD(n,k)!=1 all numbers are divisible by GCD(n,k) therefore contains no prime At GCD(n,k)==1 we have https://en.wikipedia.org/wiki/Dirichlet%27s_theorem_on_arithmetic_progressions https://en.wikipedia.org/wiki/Dirichlet%27s_theorem_on_arith... - so those series contain infinitely many primes - and seems like they actually contain at least one prime in all the pixels of the first N rows (but this should be explained/proved, if it is always true for any chosen N, or just happen to be true for the N-s tried by the OP)
- tomsmeding 8y agoYou're onto it: what you say would still need to be proven is actually not even true, see anderskaseorg's comments, e.g. https://news.ycombinator.com/item?id=17104624 https://news.ycombinator.com/item?id=17104624. So their picture is nice, and the gcd!=1 cells are all red, but the gcd=1 cells need not be black. For odd N this fails loads of times (always?), and for even N you quickly find failing cells when you start looking for it (see linked comment).
- deleted 8y ago[deleted]
- ddtaylor 8y agoDoes this get us closer to being able to generate the Nth prime without factorization / primality test of every number?
- enedil 8y agoNo, very far from it
- mathythrowaway 8y agoThis just shows the reduced residues mod n. There are n squares in the nth row from the top. Color the kth square of the nth row black if gcd(k,n)=1, color it red otherwise.
- tgb 8y agoThat's what the OEIS sequence they link to says. I hadn't realized that it makes such a beautiful pattern!
- gowld 8y agoHow is that? Isn't it plotting a prime spiral, not GCD? Obviously prime implies gcd=1, but the "kth" square isn't "k", because it's a spiral counting up from the center.
- mathythrowaway 8y agoNo, it isn't plotting a prime spiral. Each square in their triangle is a block of 75 numbers. Within the nth row the numbers are sorted by residue mod n.
- chickenstrips 8y agoYou're correct. The correspondence just seems to be due to some bound on the prime gap for arithmetic progressions (or perhaps something even more trivial that I'm missing). A cursory search suggests it might be a consequence of Ingham's bound. In any case, it doesn't yield much of interest.
- airesearcher 8y agoWe will be happy with "it's a really pretty visualization of the primes" or "it's an improvement on the Ulam Spiral." But if it has more value than that (not sure.. but possibly there is some link in this that might be useful) then that's great too.
- anderskaseorg 8y agoThe drawing is incorrect. More specifically, it’s a drawing of OEIS A054521 (black if gcd(row, col) == 1, red otherwise), not of the parallax compressed primes. The two drawings do not match as claimed. The first place where they differ is row 9, column 1, which is drawn as black even though none of 217, 226, 235, 244, 253, 262 are prime. It’s clear that gcd(row, col) == 1 is a necessary condition for there to be any primes in that cell (which consists of the numbers col + 3row² − 3row, col + 3row² − 2row, col + 3row² − row, col + 3row², col + 3row² + row, col + 3row² + 2row), but it’s not sufficient. There’s no way it could be sufficient, because there are only constantly many (six) numbers tested in every cell, but the asymptotic density of the primes goes to 0 and the asymptotic density of A054521 goes to 6/π².
- mathythrowaway 8y agoTheir picture is correct, but only because they are doing something more ridiculous than this. Every one of the squares in their picture represents 75 numbers, not 5 numbers.
- anderskaseorg 8y agoClick on the definition of T, and you see exactly the A054521 formula. T = (n, k) => { return (GCD(n, k) == 1) ? 1 : 0; } The given code doesn’t use primes, primesSet, or isPrime at all.
- mathythrowaway 8y agoBut that does produce a picture identical to theirs. Because they are using 75 numbers per square, they do end up hitting at least one prime in each box with (n,k)=1 for the first 75 rows. This pattern won't continue much longer, which is why they've conveniently stopped the picture at that point.
- _rpd 8y agoThe claim is that using N numbers per square will result in the pattern holding for N rows, for arbitrarily large N.
- Whitespace 8y agoIt wasn't exactly clear to me when I read the article, so here's my explanation: - take a line of integers, color them black if prime, red otherwise - hexagonally arrange them in a spiral (similar to Ulam's spiral) - cut the hexagon into six equilateral triangles - overlap the triangles (rotate where necessary) - if any pixels are black, color the whole thing black, if none are black, color it red - interesting pattern arises - interesting pattern already exists as per http://oeis.org/A054521 http://oeis.org/A054521 Edit: They may be packing more than 6 numbers into a pixel, looks like 75. Unsure how that would look visually, but you extend the above to use 75 or any other number. Unsure why 75 was chosen, maybe it's the only interesting one?
- szemet 8y agoJust check the numbers listed in one of the referenced articles, it is easy to expand it by induction to numbers greater than 6: https://beta.observablehq.com/@montyxcantsin/unwinding-the-ulam-spiral https://beta.observablehq.com/@montyxcantsin/unwinding-the-u... It also helps to understand my other comment about the explanation of the pattern and GCD equivalence...
- deleted 8y ago[deleted]
- drdeca 8y agoI am a little confused. When it says that each square corresponds to n sequential numbers, does it mean that the first square is the first n, and the second square (which is on the second row) is the first n after those, and the third square (also in the second row) has the first n after those, and so on, Or, do the regions overlap? I tried to look at the first 4 rows for n=5, but did not see the pattern depicted (each interval had a prime in it). Am I interpreting what is meant by the blocks incorrectly, or does the pattern not work for small enough n?
- chickenstrips 8y agoFor fixed n, a block (x,y) contains the numbers n/2y^2-n/2y + yz + x for all 0 <= z < n.
- SomeMathComment 8y ago(n/2)y^2-(n/2)y + yz + x
- drdeca 8y agoMaking sure I am parsing that correctly: Is that ((n/2) * y^2) - ((n/2) * y) + (y * z) + x ? (For z ranging from 0 to n) If so, alright, that makes more sense to me, thanks. So, n * (y * (y-1)/2) + x + y * z ? Edit: does HN have an escape character to deal with the asterisks?
- dEnigma 8y agoHaving whitespace after the asterisk or indenting the line by two or more spaces seem to be the only possibilities according to the "Formatting Options"[1] [1]https://news.ycombinator.com/formatdoc https://news.ycombinator.com/formatdoc
- evancox100 8y agoWhat would it look like if instead of a binary coloring, you used a gradient coloring representing the number of primes in each range?
- sixstringtheory 8y agoI played around with the cool demo posted by no_gravity: https://news.ycombinator.com/item?id=17104652 https://news.ycombinator.com/item?id=17104652 replace the source with the one I dropped here and hit Go: https://pastebin.com/aw9nRmeZ https://pastebin.com/aw9nRmeZ It's actually fun to run the original first and then watch the colors overlay on top of it.
- macawfish 8y agoThank you! I tried doing this with the observablehq version and got really "lost in the Ulam Spiral" of opening and closing functions.
- OmIsMyShield 8y agoI fiddled with your version and changed the colours to a heatmap-like colour scheme adapted from https://stackoverflow.com/questions/12875486/what-is-the-algorithm-to-create-colors-for-a-heatmap https://stackoverflow.com/questions/12875486/what-is-the-alg... This shows the pattern again:https://imgur.com/qR4iGJb https://imgur.com/qR4iGJb Further fiddling ~shows~ highlights more patterns: https://imgur.com/a/Yjln2RX https://imgur.com/a/Yjln2RX
- no_gravity 8y agoThis made me curious, so I wrote a javascript version that renders a larger image of it: http://www.gibney.de/parallax_primes http://www.gibney.de/parallax_primes
- vietjtnguyen 8y agoUsing your frames here's the sequence as N goes from 2 to 90 with a stride of 2: https://streamable.com/l7r96 https://streamable.com/l7r96
- infogulch 8y agoThis is what I wanted to see! Like others have said this looks like it approaches that image as N grows large.
- vadansky 8y agoSo does the pattern work or not? People are saying it's not plotting primes, but there is clearly a prime check in this code
- _rpd 8y agoThe original pattern uses prime check (as per this code). OP claimed an exact match with http://oeis.org/A054521 http://oeis.org/A054521 - but this isn't true for many N (see vietjtnguyen's streamable). Perhaps it approaches it as N grows large?
- deleted 8y ago[deleted]
- acmegeek 8y agoI really liked your approach. I made a few modifications. http://htmlpreview.github.io/?https://github.com/acmegeek/primes/blob/master/index.html http://htmlpreview.github.io/?https://github.com/acmegeek/pr... I changed it to render with circles vs squares, and have them stack nicely. Also, have the variables more isolated to test. Also, it counts how many primes are within a pack, and assigns the color proportionately. This is still a work in progress.
- m00n 8y agoI wonder why the authors took the time to generate an image of their pattern but refrained from giving the actual DEFINITION. This does not foster constructive discussion of any possible ideas present. As can be seen in dozens of well-meaning comments here, people waste time reversing and guestimating parameters etc. Looking at the layman letters that my institute gets on a regular basis, I can say, that this is unfortunately a recurring theme with amateur mathematicians: They fail to state their basic definitions and assumptions and seem all to eager to dive right into applications, be it computer graphics, cryptography or finance. More to the point: This picture seems from a cursory inspection to plot T(k,n) with n=row, k=column from the top left. But why is this interesting?
- andrepd 8y agoAs far as I could gather from one of the links in the article, the definition seems to be "cell n is black if there is a prime in the interval [Rn , R(n+1)[, for R a natural number". The "pattern" supposedly holds for R rows when displayed in a triangular arrangement, equivalently R^2/2 cells
- Recursing 8y agoThat's what they say, but the generated image is different (e.g. the first cell of the second row should be red)
- deleted 8y ago[deleted]
- macawfish 8y agoThat's because amateur mathematicians are artists :)
- svat 8y agoI think I figured out what the authors were claiming/drawing, and an actual definition: https://news.ycombinator.com/item?id=17106193 https://news.ycombinator.com/item?id=17106193
- jhayward 8y ago
- airesearcher 8y agoShaun is going to update the code with some additions that will hopefully help clear up some of the questions / confusion below. We will also post Mathematica code that is more rigorous. And a new finding. Stay tuned.
- angel_j 8y agoIf you throw out the last cell of every row, the pattern is symmetrical.
- laurilove 8y agoAppropriate juncture to repost this: https://www.youtube.com/watch?v=sD0NjbwqlYw https://www.youtube.com/watch?v=sD0NjbwqlYw
- laurilove 8y agoAppropriate juncture to repost this: https://www.youtube.com/watch?v=sD0NjbwqlYw https://www.youtube.com/watch?v=sD0NjbwqlYw "Visualizing the Riemann zeta function and analytic continuation" (Watch the last 30s or so if nothing else. You'll not regret it.) There is a kind of 'real' Ural spiral [or really a kind of chaotically decaying 'orbit'] related dynamic that gives the prime numbers (assuming the RH.) Conceivable that OP's pattern might have some relation to this dynamic, and fun pondering to boot.
- mortehu 8y agoI wrote some code to replicate this in the console, overlaying A054521 (in colors) onto their triangle (using _ and #) for any N. The output from running ./prime-triangle.py 74 is included as x_output_74.png. It's not fancy, but it could save you some time trying to figure out what the actual formulae are. https://gist.github.com/mortehu/ccca0bafc7a9caa26d6008379057e3cc https://gist.github.com/mortehu/ccca0bafc7a9caa26d6008379057... Edit: Other than 2, 14, 20, 30, 38, 44, 50, and 74, the two patterns match perfectly for every even N up to at least 600. Edit 2: Looks like this is related to Linnik's theorem: https://en.wikipedia.org/wiki/Linnik%27s_theorem https://en.wikipedia.org/wiki/Linnik%27s_theorem
- emgee_1 8y agoMaybe it is good to know that within the sequence of all prime numbers there infinitely wide gaps : take (n+1)! +2, (n+1)! +3, ..., (n+1)! + (n+1) That is a sequence of n consecutive numbers none of which are prime. Not sure how that would map in this triangle shape yet.
- airesearcher 8y agoHere is a Dropbox link to the Mathematica code. Thanks to some of the input today we have found that this pattern does not exactly match the gcd triangle - which actually makes this more interesting in a way. https://www.dropbox.com/s/d2dfwhxdmzkp4y4/a-pattern-in-the-primes.nb?dl=0 https://www.dropbox.com/s/d2dfwhxdmzkp4y4/a-pattern-in-the-p...
- deleted 8y ago[deleted]
- scotty79 8y agoThe way the numbers are picked into the 75-number groups is responsible for pretty symmetry. If you replace condition isPrime() with simpler checks: "is not divisible by 2" "is not divisible by 2 and 3" .. "... by 2, 3 and 5" .... "... by 2,3,5,7,13,17 and 23" ... you'll get more and more complex images but still symmetrical. For me the whole thing is subtle hiding of messiness of primes into the strong, pretty, symmetrical shape which obscures the mess and just gets richer and more artistic due to that. Experiment with the code provided by user no_gravity here: http://www.gibney.de/parallax_primes http://www.gibney.de/parallax_primes By changing the contents of isPrime() function you can see how you get fooled into thinking there's order in primes by mixing messiness of primes into the order of number picking scheme.
- deleted 8y ago[deleted]
- no_gravity 8y agoI was thinking in the same direction but could not come up with a simple test. Your idea to start with "is not divisible by 2 .. 3 .. 4 .." is great. It's interesting, that up to 4, it's a perfect pattern: function isPrime(n) { return n%2 && n%3 && n%4; } As soon as you get to 'Not divisible by 5' noise starts to appear: function isPrime(n) { return n%2 && n%3 && n%4 && n%5; } This 'noise' closes some gaps between the pattern and makes it look like runes. Would any type of noise do this? Here is how it looks like with some random noise added: function isPrime(n) { return n%2 && n%3 && n%4 && (Math.random()>0.95); } It is not as structured as the version based on primes. As of now, I'm not sure what to make of it. Maybe there is some other type of simple 'noise' that creates something as complex and logical as the primes. Maybe not.
- cbsmith 8y agoIs this really capturing a pattern in primes, or a pattern in non-primes (which is totally not surprising).
- vokep 8y agoIt may turn out to be a pretty small part, but history was made today :) keep it up, stuff like this is awesome! You may not be mathematicians and it may turn out this is nothing hugely new, but even so, the proof of such itself is interesting. keep up the cool work!
- seanstickle 8y agoFor those that like to mess around with the J programming language, here is what I believe is correct code to generate this parallax compression pattern. pack =: 3 : '+./ (r,y+1) $ (npc*y+1) {. (npc*y) }. p' "0 pc =: 3 : 0 r =: npc =: y c =: +/ 1+i.y p =: 1 p: (1+i.c*npc) pack i.r ) Image of output for numbers-per-cell = 75 here: https://twitter.com/seanstickle/status/997675789264015361 https://twitter.com/seanstickle/status/997675789264015361
- airesearcher 8y agoThe Javascript code at Observable has been updated to render it correctly for both even and odd values of n now. This addresses the issues that were pointed out below for the most part. In short, actually there are some curious patterns in this, and they are not simply equivalent to OEIS A054521 (as we, and others, initially thought they were). For even values of n, they can be rendered by the GCD sequence, without the primality testing. But for odd values the pattern is different and GCD doesn't describe it. The Mathematica code on Github lets you experiment with this. There are some nice versions, and experiments in different ways of coloring or arranging the graph in the Telegram group as well. Telegram group https://t.me/joinchat/G8AnchIna2q8yn1lGHirkA https://t.me/joinchat/G8AnchIna2q8yn1lGHirkA Javascript code https://beta.observablehq.com/@montyxcantsin/unwinding-the-ulam-spiral https://beta.observablehq.com/@montyxcantsin/unwinding-the-u... Mathematica code: https://github.com/shaunxcode/a-pattern-in-the-primes https://github.com/shaunxcode/a-pattern-in-the-primes
- airesearcher 8y agoAlso there are versions in Perl and other languages in the Telegram group.
- svat 8y agoOne correction (already accepted by your co-author @shaunxcode) is that even for even n, your triangle and the one formed by OEIS A054521 are not equivalent. Specifically, here are some values of N, and (row, column) coordinates where the gcd sequence and your sequence differ: Counterexample: N=14, (R,C) = (13, 3) Counterexample: N=20, (R,C) = (17, 8) Counterexample: N=20, (R,C) = (19, 1) Counterexample: N=30, (R,C) = (17, 7) Counterexample: N=30, (R,C) = (19, 1) Counterexample: N=38, (R,C) = (37, 8) Counterexample: N=44, (R,C) = (31, 2) Counterexample: N=44, (R,C) = (37, 2) Counterexample: N=50, (R,C) = (43, 13) Counterexample: N=74, (R,C) = (73, 43) (For n=74, look at the last shown row in the post right now, for N=73, where there's a “stray” red dot: this dot wouldn't be present in the computed-from-gcd sequence.) There are very few counter-examples though (larger ones seem hard to find); you can see some reasons in my long comment here: https://news.ycombinator.com/item?id=17106193 https://news.ycombinator.com/item?id=17106193 Here's a rough heuristic calculation for how many counterexamples we should expect. Let's say gcd(R,C)=1, so that there should be no “special reason” to expect everything in the set to be composite. Then, as the set contains N numbers each of size roughly (NR^2/2), each is prime with “probability” 1/log(NR^2/2) — this is the Cramer heuristic — so the probability that all of them are composite is (1 - 1/log(NR^2/2))^N < (1 - 1/log(N))^N ≈ e^(-N/log N). Even with about N^2/2 chances for a counterexample, the expected number of counterexamples (union-bound) is only N^2e^(-N/log N), so for sufficiently large (even) N, the probability of the two drawings differing at any point should be vanishingly small. In fact, by this heuristic, we should expect only finitely many counterexamples, so quite likely the 10 above are the only ones.
- airesearcher 8y agoHere is an animation (thanks to Ian Rust) showing how the even values of n approach the GCD pattern (OEIS A054521) as the values increase https://streamable.com/l7r96 https://streamable.com/l7r96 however the odd values of n are not equivalent to the GCD pattern.
- mauool 8y agoin an Hexagon is a pattern following rules of the fibonacci spiral... but never told anybody about it cause of the effect....
- macawfish 8y agoThe prime numbers are interesting no matter how you slice and dice them!
- airesearcher 8y agoUPDATE - Saturday May 19 Join the Telegram group to discuss: https://t.me/joinchat/G8AnchIna2q8yn1lGHirkA https://t.me/joinchat/G8AnchIna2q8yn1lGHirkA Note that Even and Odd Values of N have a very different pattern. For example try using the values 99 and 99, and then 100 and 100, in this HTML preview version: https://htmlpreview.github.io/?https://github.com/acmegeek/primes/blob/master/index.html?11 https://htmlpreview.github.io/?https://github.com/acmegeek/p... Here is animation of increasing even values of N approaching GCD: https://streamable.com/l7r96 https://streamable.com/l7r96 CODE TO TRY: Javascript https://beta.observablehq.com/@montyxcantsin/unwinding-the-u.. https://beta.observablehq.com/@montyxcantsin/unwinding-the-u.... Mathematica https://github.com/shaunxcode/a-pattern-in-the-primes https://github.com/shaunxcode/a-pattern-in-the-primes Perl https://www.dropbox.com/s/z5tfub5geyuctex/prime-draw.pl?dl=0 https://www.dropbox.com/s/z5tfub5geyuctex/prime-draw.pl?dl=0 EXPLANATION: In short, actually there are some curious patterns in this, and they are not simply equivalent to OEIS A054521 (as we, and others, initially thought they were). For even values of n, they can be rendered by the GCD sequence, without the primality testing. But for odd values the pattern is different and GCD doesn't describe it.