Skip to main content

segmented_sieve

Function segmented_sieve 

Source
pub fn segmented_sieve(low: u64, high: u64) -> Vec<u64>
Expand description

All primes in [low, high] by a segmented sieve: base primes up to √high cross off a window of the requested range only, so the memory is O(√high + (high − low)). The base sieve dominates the cost for very large high (it reaches 2³² near u64::MAX).