Is There a Way to "Rewire" Desmos to Run Prime-Finding Algorithms?

I tried running Untitled Graph | Desmos and Prime numbers and Mersenne Prime Finder | Desmos to look for prime numbers where floor(log_10(x))+1>10^999999. Any ideas?

The maximum integer in Desmos is 2^53 … so the numbers you’re trying to use vastly exceed that limit.
Moreover consider that the calculations (of this algorithm) to check if a number is prime are proportional to the size of the number. So to check if 2^53 - 1 is prime it would take 2^53 divisions (and some more operations …) … this means that it would take a really long while …

1 Like

You can also simplify the code a bit like this:
https://www.desmos.com/calculator/84abvufyc1

Aslo: if you want to check for primality you can stop looking for divisors when you reach the square root of the number.

2 Likes