Quantcast
Channel: Fastest way to find prime in intervals - Stack Overflow
Browsing all 4 articles
Browse latest View live

Answer by rossum for Fastest way to find prime in intervals

Yes, you can make it more efficient. As has been mentioned, for very large numbers use Miller-Rabin. For smaller ranges use the Sieve of Eratosthenes. However, apart from that, your prime checker code...

View Article



Answer by oppressionslayer for Fastest way to find prime in intervals

I wrote an equation based prime finder using MillerRabin, it's not as fast as a next_prime finder that sieves, but it can create large primes and you get the equation it used to do it. Here is an...

View Article

Answer by zerecees for Fastest way to find prime in intervals

Yes. In general, use:Sieve of EratosthenesMiller-Rabin Primality TestOther options include trying a compiled language, like C++, but I think that isn't what you're looking for, since you've asked about...

View Article

Fastest way to find prime in intervals

I tried searching StackOverflow and some other sources to find the fastest way to get a prime number within some interval but I didn't find any efficient way, so here is my code:def prime(lower,upper):...

View Article
Browsing all 4 articles
Browse latest View live




Latest Images