Segmented sieve