Expand description
Functions that sieve primes from the integers up to an input maximum.
Functions§
- eratosthenes_
sieve - An implementation of the sieve of Eratosthenes, as described in the Wikipedia article.
- segmented_
sieve - A segmented approach to sieveing, keeping memory use to O(√n). As Sorensen states, this is the most practical optimization to the sieve of Eratosthenes.
- segmented_
sieve_ parallel - Same algorithm as the regular
segmented_sievefunction, but each larger segment to be sieved is computed in parallel threads.