4 ms·
> One way in which the complexity of this is bad is that if you want prime numbers < N you only need to filter out primes smaller than sqrt(N). It is telling th
by merijnv 7y ago
> One way in which the complexity of this is bad is that if you want prime numbers < N you only need to filter out primes smaller than sqrt(N). It is telling that the first solution contains an sqrt but not the second one....
That's not really true, though, because that filter is applied lazily, so it only get evaluated up until the Nth prime and no further.