Primes might not be that chaotic after all

So a LONG time ago I watched a 3blue1brown video about prime numbers, and today it suddenly just came to me and I made this (fixed link) visual representation of it.

PS: If anyone could make the prime calculator faster, I will be very happy :slight_smile:

1 Like

I think you inserted the wrong link … the link just goes to 3blue1brown video …

I did, sorry guys :frowning: Corrected: Polar Primes | Desmos

@Guzman_Tierno

You can substitute Expression#4 with:
D_ivResult = mod(P_find, P_rimes)

this will make it immediately much faster

You can also update P like this:
P \to P+2
to skip even numbers.

And here’s a better way to check for primes:

I_sprime = \prod_{n=1}^{L.count} sign(mod(P,L[n]))

see here:
https://www.desmos.com/calculator/rnawuyouip

1 Like

I did, I actually figured that out before you said this :heart:

I will add all of this, tysm

I will do this after I get out of school and see the results

And you can make it much faster by limiting the checks up to
the square root of the number you are checking:

\prod_{n=1}^floor(sqrt(P) sign(mod(P,L[n]))

https://www.desmos.com/calculator/rnawuyouip

I think the biggest issue is that as the list growers larger, it will be slower. Because when I am running it with a 6200 long list, it is still very slow.

i also have a graph of all numbers,with their angles being squared that would be interesting to be graphed with only primes:

zoom out and you can see it
the graph is (in polar cordanites)(a,a^2)

A possible trick (or cheat) could be to just create the list of the first 10000 primes once and for all … so you don’t need to run any code …

Yes, things get slower because of the length of the list but also because for each number you need to test hundreds of divisors …

thats what I’m trying to do

No code:
https://www.desmos.com/calculator/erizklvf3o

1 Like

Btw, you can see the 280 rays now :slight_smile: (anyone wanna count to verify?)

you can sort of count them with Desmos:
https://www.desmos.com/calculator/amiqtrgn9h