Note that there are some explanatory texts on larger screens.

plurals
  1. PO
    primarykey
    data
    text
    singulars
    1. This table or related slice is empty.
    plurals
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. VO
      singulars
      1. This table or related slice is empty.
    2. VO
      singulars
      1. This table or related slice is empty.
    3. VO
      singulars
      1. This table or related slice is empty.
    1. COActually I don't think primegen is the fastest, or even the second-fastest; yafu and primesieve are both faster in general, I think, and certainly over 2^32. Both are (modified) sieves of Eratosthenes rather than the Atkin-Bernstein sieve.
      singulars
    2. CO[Primesieve](https://code.google.com/p/primesieve/) Sieve of Eratosthenes (SoE) is the very fastest algorithm possible and will always be faster than any implementation of the Sieve of Atkin SoA, including Bernstein's as linked in this answer because primesieve reduces the number of operations compared to SoA: For the 32-bit number range (2^32 - 1), primesieve does about 1.2 billion culls whereas SoA does a total of about 1.4 billion combined toggle and square free operations, both operations being of about the same complexity and able to be optimized in about the same way.
      singulars
    3. COContinued: Bernstein only compared the SoE using the same effective wheel factorization as for the SoA, which is a 2;3;5 wheel, use of which wheel results in about 1.83 billion culls over the 32-bit number range; this makes the SoA about 30% faster **when comparing this restricted version of SoE** for equivalent other optimizations. However, the primesieve algorithm uses a 2;3;5;7 wheel in combination with a 2;3;5;7;11;13;17 wheel segment pre-cull to reduce the number of operations to about 1.2 billion to run about 16.7% faster than SoA with equivalent operation loop optimizations.
      singulars
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload