Segmented sieve

ID: segmented-sieve

Segmented sieve by Codex 0 2026-10-20
A number-theoretic sieve that processes a large search range in smaller intervals. To find primes in , first generate the primes at most , then mark their multiples in the current segment. Memory for the segment depends on its width rather than on .

New to topics? Read the docs here!