
An Interesting Pattern in the Prime Numbers: Parallax Compression - airesearcher
http://www.novaspivack.com/science/we-have-discovered-a-new-pattern-in-the-prime-numbers-parallax-compression
======
anderskaseorg
The 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
Their 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
Click 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
But 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.

~~~
airesearcher
From what we have seen in our tests, the pattern holds for the number of rows
n, where n = the number of integers contained in a cell. After n rows the
symmetry breaks. We haven't tested every possible n yet however. It would be
great to do more tests and let's see if there are exceptions.

~~~
airesearcher
Actually someone did point out an exception and it generates something very
interesting we didn't see before. The pattern is different for odd n. But also
has an interesting self-similarity. See the discussion on Telegram about this.
[https://t.me/joinchat/G8AnchIna2q8yn1lGHirkA](https://t.me/joinchat/G8AnchIna2q8yn1lGHirkA)

------
m00n
I 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
As 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
That's what they say, but the generated image is different (e.g. the first
cell of the second row should be red)

------
md224
Awesome! 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...](https://math.stackexchange.com/questions/2654984/identifying-
this-chaotic-recurrence-relation)

~~~
Senderman
Keep 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
> 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.”

~~~
Senderman
It 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.

~~~
Mediterraneo10
I am sceptical of the ability of laymen to even meaningfully understand the
field that I am in enough to contribute their own ideas. The amount of
literature that would have to be read and assimilated is vast, really
achievable only for academics. My prewritten response would only be “Do at
least an MA in this field, then we’ll talk”.

~~~
Senderman
I genuinely think that's a good response.

Maybe the majority of recipients won't act, or they'll even take offense, but
if somebody in there chose to contact you because they look up to your
position, you could easily find in a few years that you challenged somebody to
get on the right track with one of those responses. Some people are on the
fence and looking for a push.

Obviously it's up to you, but I think it's worth a shot.

------
airesearcher
Yep - 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!

~~~
Someone
_”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
Actually there is a pattern. Take a look at the Mathematica code on GitHub.

~~~
anaphylactic
I think the parent's trying to tell you guys not to sell yourselves short -
that what you're doing is exactly what mathematics is.

------
no_gravity
This 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
Using 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
This is what I wanted to see! Like others have said this looks like it
approaches that image as N grows large.

------
scotty79
The 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.

~~~
no_gravity
I 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.

------
szemet
My 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_arith...](https://en.wikipedia.org/wiki/Dirichlet%27s_theorem_on_arithmetic_progressions)
\- 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
You'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).

------
Whitespace
It 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
Just 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-u...](https://beta.observablehq.com/@montyxcantsin/unwinding-the-ulam-
spiral)

It also helps to understand my other comment about the explanation of the
pattern and GCD equivalence...

------
mortehu
I 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/ccca0bafc7a9caa26d6008379057...](https://gist.github.com/mortehu/ccca0bafc7a9caa26d6008379057e3cc)

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)

------
BicyclRepairMan
From 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
Yes, but only up to a certain point. Larger semiprimes are still a pita to get
the primes out of.

------
phyzome
My 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
Other 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
I think the relationship is that the sieve has a natural shape since it's
based on ruling out multiples.

~~~
asynchrony
Isn’t the sieve’s eventual shape just the list of prime numbers?

------
Tossrock
A 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
It'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

------
WaxProlix
> 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...

~~~
enedil
We 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_determinis...](https://en.wikipedia.org/wiki/Primality_test#Fast_deterministic_tests)

~~~
yorwba
Note that log(n) is the length of the prime, so if you are using 2048 bit
primes, log⁶(n) is quite large. I don't think anyone actually uses one of the
general deterministic primality testing algorithms in cryptographic
applications.

------
airesearcher
Shaun 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.

------
evancox100
What would it look like if instead of a binary coloring, you used a gradient
coloring representing the number of primes in each range?

~~~
sixstringtheory
I 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.

~~~
OmIsMyShield
I fiddled with your version and changed the colours to a heatmap-like colour
scheme adapted from [https://stackoverflow.com/questions/12875486/what-is-the-
alg...](https://stackoverflow.com/questions/12875486/what-is-the-algorithm-to-
create-colors-for-a-heatmap)

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)

------
mathythrowaway
This 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.

~~~
gowld
How 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
No, 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.

------
placebo
Just 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 :-)

------
kibwen
These 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
I'd like to see the triangle fractal as a starting state for Conways "Game of
Life".

~~~
drdeca
As 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
Who 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.

------
airesearcher
The 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-u...](https://beta.observablehq.com/@montyxcantsin/unwinding-the-ulam-
spiral)

Mathematica code: [https://github.com/shaunxcode/a-pattern-in-the-
primes](https://github.com/shaunxcode/a-pattern-in-the-primes)

~~~
svat
One 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
Here is animation by Ian Rust that shows how the pattern approaches GCD as the
even values of n increase.

[https://streamable.com/l7r96](https://streamable.com/l7r96)

Note that for odd values of n the pattern does not resemble GCD.

------
PurpleBoxDragon
Is 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-u...](https://beta.observablehq.com/@montyxcantsin/unwinding-the-ulam-
spiral)

~~~
pcmaffey
Because primes exist on a base 6 numeric scale. Where all prime numbers are
multiples of 1 and 5.

~~~
anyfoo
... I think that statement is only true for the prime number 5. ;)

~~~
pcmaffey
Base 6:

1,2,3,4,5,6

7,8,9,10,11,12

13,14,15,16,17,18

19,20,21,22,23,24

25,26,27,28,29,30

See a pattern? 2 & 3 are the only prime numbers that are an exception. All
others are multiples of 1 and 5.

~~~
dragonwriter
> All others are multiples of 1 and 5.

Assuming you used “and” when you meant “or”, that's trivially true (and
redundant) in that all numbers (irrespective of base, which has no effect on
this) are integer multiples of 1.

But no primes other than 5 are integer multiples of 5, in any base.

~~~
pcmaffey
> Senary may be considered interesting in the study of prime numbers, since
> all primes other than 2 and 3, when expressed in senary, have 1 or 5 as the
> final digit.

[https://en.wikipedia.org/wiki/Senary](https://en.wikipedia.org/wiki/Senary)

I expressed it poorly, but not as you state, incorrectly.

~~~
dragonwriter
> I expressed it poorly, but not as you state, incorrectly.

No, really, it _is_ completely incorrect to use “multiple of X in base Y” to
mean “have X as the final digit in base Y” (which is equivalent to “is
congruent to X modulo Y.”)

13 is not, in base 10 (or anywhere else), a multiple of 3.[0]

That's just not what “multiple” means.

[0] Well, the number denoted by the digits “13” in any base that is itself a
multiple of 3—other than base 3 itself where “13” is not a valid number—is a
multiple of 3, obviously, but we're talking about the number represented by
“13” in base 10.

------
airesearcher
UPDATE - 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/p...](https://htmlpreview.github.io/?https://github.com/acmegeek/primes/blob/master/index.html?11)

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.

------
vadansky
Just 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

------
airesearcher
We 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.

------
drdeca
I 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
For fixed n, a block (x,y) contains the numbers n/2 _y^2-n /2_y + yz + x for
all 0 <= z < n.

~~~
drdeca
Making 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
Having 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)

------
Invictus0
The Ulam Spiral:
[https://en.m.wikipedia.org/wiki/Ulam_spiral](https://en.m.wikipedia.org/wiki/Ulam_spiral)

~~~
lucb1e
Desktop link:
[https://en.wikipedia.org/wiki/Ulam_spiral](https://en.wikipedia.org/wiki/Ulam_spiral)

------
airesearcher
Here 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-p...](https://www.dropbox.com/s/d2dfwhxdmzkp4y4/a-pattern-in-the-
primes.nb?dl=0)

------
lucb1e
The 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
fixed

------
emgee_1
Maybe 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.

------
seanstickle
For 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)

------
wyas
This is awesome. How can we access the code to play around with?

~~~
shaunxcode
It is in an observable doc so you can fork it etc.
[https://beta.observablehq.com/@montyxcantsin/unwinding-
the-u...](https://beta.observablehq.com/@montyxcantsin/unwinding-the-ulam-
spiral)

------
crankylinuxuser
I'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)

------
airesearcher
Here 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.

------
nautilus12
Is 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
I 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-u...](https://beta.observablehq.com/@montyxcantsin/unwinding-the-ulam-
spiral)

------
cbsmith
Is this really capturing a pattern in primes, or a pattern in non-primes
(which is totally not surprising).

~~~
Jupe
Whats the diff?

~~~
cbsmith
Well, every third number is a non-prime. There's no pattern like that for
primes.

------
aj7
“Fooled by randomness.”

------
macawfish
The prime numbers are interesting no matter how you slice and dice them!

------
folkstack
I wonder if there's a pattern to how many primes per cells-with-primes.

------
vokep
It 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!

------
felipellrocha
This is... Amazing...!

------
mauool
in an Hexagon is a pattern following rules of the fibonacci spiral... but
never told anybody about it cause of the effect....

------
ddtaylor
Does this get us closer to being able to generate the Nth prime without
factorization / primality test of every number?

~~~
enedil
No, very far from it

------
angel_j
If you throw out the last cell of every row, the pattern is symmetrical.

------
sandworm101
"It looks like something they found on the ship at Roswell."

------
tzahola
The pattern looks nice, but I would have asked some mathematicians before
announcing this as something novel.

~~~
ythn
Come 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
Well, 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.

~~~
tathougies
> 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.

~~~
jadedhacker
Nonetheless, even though it's highly embarrassing to the parties involved,
with a little bit of self-deprecating humor if I was the doctor, I could tell
people at parties that I, along with Newton and Leibnitz have been published
on a foundational numerical integration method. ^_^

~~~
tathougies
ha!

------
toblender
If 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.

~~~
chickenstrips
No, 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.

