
In many beautiful plots and videos, we see the prime numbers spiraling out when plotted with polar coordinates, I've included some great video links below.
They make the point though that the distribution of the primes is not explained by the spirals themselves.
That however is not entirely true, because upon looking closer, there are secondary spirals within the spiraling number lines, emerging from the primes themselves (and the composites in fact, but they're completely contained within their "parent primes") – those act as a "sieve" function, identifying each composite number and leaving the primes uniquely untouched.
Plotting k mod 6 +/- 1 and then "walking" along those two sequences in "hops" from a given prime >3, e.g. starting with 5 – then walking 5 hops along the first sequence, we arrive at 35, not a prime, or walk forwards, we arrive at 25, not a prime (indeed the forwards walk is always the square).
Same goes for 7, walk backwards, we also arrive at 35 (it's 5*7 after all) and walking forward 7 hops takes us to 49, and so on, and you'll observe that it's 5*7, 5*11, 7*5, 7*11, and so on, i.e. the primes themselves multiplying to generate the composites.
The image shows the "crazy", but then zooms into just the behaviour of 5, 7 and then 5,7,11,13 overlaid. The pattern continues to infinity, just with counting, you can get tricksy with modular arithmetic and recognise that the "hops" are index * 6 * prime number + prime number or – prime number to walk backwards.
It generates the entire sequence of the primes and their gaps.
Prime Spiral Videos for context
3blue1brown – https://www.3blue1brown.com/lessons/prime-spirals
numberphile – https://youtu.be/iFuR97YcSLM?si=VqKr3_hymM9KldLp
by RandomiseUsr0
2 Comments
Plotted using plain old Excel. The coordinates generated by straightforward COS and SIN, the magic “+20” simply introduces spacing to give the numbers room to breathe
=COS(A4#)*FLOOR.MATH(A4#+20)
=SIN(A4#)*FLOOR.MATH(A4#+20)
““Excel
=LET(
x, SEQUENCE(1213),
xx, TRANSPOSE(x),
a, MOD(x,6)=1,
b, MOD(x,6)=5,
seqA, DROP(FILTER(x,a),1),
seqB, FILTER(x,b),
seqAHop, 6*seqA,
seqBHop, 6*seqB,
VSTACK(
(seqAHop * xx) – seqA,
(seqAHop * xx) + seqA,
(seqBHop * xx) – seqB,
(seqBHop * xx) + seqB
)
)
Could we just increase the lengths of the spiral and the lines to find new prime numbers?
(I’m not good at math, but I’m interested)