Sieve of Eratosthenes
How the Sieve of Eratosthenes works?
When the multiples sublime, the numbers that reman are prime. A prime number is a natural number that has exactly two district natural number divisions. 1 and itself.
Here is a good video explaining how does de Sieve of Eratosthenes work.