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 ArticleAnswer 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 ArticleAnswer 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 ArticleFastest 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
More Pages to Explore .....