= Odd-only segmented sieve
= Segmented odd-only sieve
{synonym}
An <odd-only segmented sieve> represents only odd <integers> in each bounded interval, handling the prime two separately. For an odd first represented value $L$, <array> index $i$ stands for $L+2i$. To mark multiples of an odd prime $p$, begin at the smallest odd multiple at least $\max(L,p^2)$ and advance by $2p$, corresponding to index stride $p$. Base primes up to the square root of the upper endpoint suffice. The segmentation <limits> working storage while omitting even candidates roughly halves it again. The number one remains nonprime and must be excluded explicitly.
Back to article page