3 ms·
I was intrigued by the nextprime() function and had to look it up. It depends on an isprime() function that in turn relies on the Miller-Rabin test, discussed
by Isamu 13y ago
I was intrigued by the nextprime() function and had to look it up.
It depends on an isprime() function that in turn relies on the Miller-Rabin test, discussed here: http://primes.utm.edu/prove/prove2_3.html http://primes.utm.edu/prove/prove2_3.html
Interesting that it combines a number of weak, probabilistic tests into a strong test (for n < 1e16)