Convert segment_primes to segment start/next/end
Speedup for basic sieve walking