Mathematics for Programmers - Sieve of Eratosthenes - Finding prime numbers
Video credits : mycodeshool
Sieve of Eratosthenes, is a simple, ancient algorithm for finding all prime numbers up to any given limit.
It finds prime numbers by iteratively marking the multiples of each prime, starting with the first prime number, 2. The multiples of a given prime are generated as a sequence of numbers starting from that prime, with constant difference between them.
Here is an illustration of how it works.
No problems available for this topic.
Join the community of 1 Lakh+ Developers
Create a free account and get access to tutorials, jobs, hackathons, developer events and neatly written articles.
Create a free account