About 105,000 results
Open links in new tab
  1. Simple prime number generator in Python - Stack Overflow

    Mar 18, 2019 · So I can see that we have right answers for different questions here; for a prime number generator gen_primes looks like the right answer; but for a prime number check, the …

  2. Which is the fastest algorithm to find prime numbers?

    Amazing to see the number of answers, when the question is absolutely impossible to answer without knowing the range of numbers to be covered. If you want all prime numbers, there is …

  3. How to implement an efficient infinite generator of prime …

    Feb 6, 2010 · Here's a generator that's a little truer to how it's done in Haskell: filtering against composites of known primes, then adding the remaining primes to the list.

  4. A Fast Prime Number Sieve in Python - Stack Overflow

    All these prime generation functions are toys really, the real stuff is working with the very big numbers, using completely different algorithms anyway. Here in the low range, what matters is …

  5. python - Generator function for prime numbers - Stack Overflow

    Sep 7, 2014 · Sieve of Eratosthenes: Most efficient prime generator algorithm Taken from here: Simple Prime Generator in Python - an answer by Eli Bendersky. It marks off all the multiples …

  6. c - Prime Generator Algorithm - Stack Overflow

    Dec 23, 2013 · 3 I've been trying to solve the SPOJ problem of Prime number Generator Algorithm. Here is the question Peter wants to generate some prime numbers for his …

  7. Basic prime number generator in Python - Stack Overflow

    Apr 23, 2015 · The above example doesn't generate prime numbers but tests them. You could adapt the same optimizations to your code :) One of the more efficient algorithms I've found …

  8. .net - Fastest way to calculate primes in C#? - Stack Overflow

    Jul 24, 2015 · If you were in a large system, then one would use a profiler to find that the prime number generator is the part that needs optimizing. Profiling a loop with a dozen or so …

  9. c++ - Prime number generation algorithm - Stack Overflow

    3 Eliminating numbers dividable by prime numbers (2,3,5,7 etc.) is a not soo bad idea when you look for a list of (small) prime numbers but you should use the newly found prime numbers too …

  10. Fastest way to list all primes below N - Stack Overflow

    Jan 15, 2010 · Years ago, pseudo-code for a version of Atkin's sieve was given on the Wikipedia page Prime number. This isn't there anymore, and a reference to the Sieve of Atkin seems to …