Related: <a href="https:&#x2F;&#x2F;en.wikipedia.org&#x2F;wiki&#x2F;Sieve_of_Sundaram" rel="nofollow">https:&#x2F;&#x2F;en.wikipedia.org&#x2F;wiki&#x2F;Sieve_of_Sundaram</a><p>Very easy to implement and much faster than even sieve of Atkin with a complexity of O((n log n)&#x2F;12)