In sieve example, end iteration sooner
The Sieve algorithm only requires checking all elements up to and including the square root of the maximum prime you're looking for. After that, the remaining elements are guaranteed to be prime.
Showing
想要评论请 注册 或 登录