Home Algebra Data Structures Dynamic Programming String Processing Linear Algebra Combinatorics Numerical Methods Geometry Graphs Miscellaneous Last update: November 25, 2023 Translated From: e-maxx.ru Linear Sieve¶ Given a number $n$, find all prime numbers in a segment $[2;n]$. The standard way of solving a task is to use the sieve of Eratosthenes. This algorithm is very simple, but it has runti