with segmented sieve