Comment by thaumasiotes
2 months ago
> As you said, you can't vectorize the outer loop because each iteration depends on the result of previous iterations
I don't see why not. That check for whether result[i] is prime is just a performance optimization. If you want to do a different performance optimization, you can do that without hurting anything.
Note that while it's true that multiples of prime numbers are composite, it's also true that multiples of composite numbers are composite.
No comments yet
Contribute on Hacker News ↗