Home Back

Sieve of Eratosthenes Calculator

Sieve of Eratosthenes Algorithm:

\[ \text{1. List numbers from 2 to n} \] \[ \text{2. Mark first prime p = 2} \] \[ \text{3. Mark all multiples of p} \] \[ \text{4. Find next unmarked number as new p} \] \[ \text{5. Repeat until p² > n} \]

numbers

Unit Converter ▲

Unit Converter ▼

From: To:

1. What is the Sieve of Eratosthenes?

The Sieve of Eratosthenes is an ancient algorithm for finding all prime numbers up to any given limit. It was created by the Greek mathematician Eratosthenes in the 3rd century BC and remains one of the most efficient ways to find small primes.

2. How Does the Algorithm Work?

The algorithm follows these steps:

\[ \text{1. Create list of integers from 2 to n} \] \[ \text{2. Let p = 2 (first prime)} \] \[ \text{3. Mark all multiples of p (2p, 3p, 4p...)} \] \[ \text{4. Find next unmarked number > p as new p} \] \[ \text{5. Repeat until p² > n} \] \[ \text{6. All unmarked numbers are primes} \]

Example for n=30:

3. Historical Significance

Details: Eratosthenes (276-194 BC) was a Greek mathematician, geographer, poet, astronomer, and music theorist. His sieve method demonstrates remarkable mathematical insight and computational thinking that predates modern computers by over two millennia.

4. Using the Calculator

Tips: Enter an upper limit between 2 and 1000. The calculator will generate all prime numbers up to your specified limit using the Sieve of Eratosthenes algorithm.

5. Frequently Asked Questions (FAQ)

Q1: Why is the Sieve of Eratosthenes efficient?
A: It eliminates composite numbers in a systematic way, requiring only O(n log log n) operations, making it very efficient for finding small primes.

Q2: What are the limitations of this method?
A: For very large numbers (billions+), memory requirements become substantial. Segmented sieve versions are used for larger ranges.

Q3: How many primes are there up to 100?
A: There are 25 prime numbers between 1 and 100: 2,3,5,7,11,13,17,19,23,29,31,37,41,43,47,53,59,61,67,71,73,79,83,89,97.

Q4: Is 1 considered a prime number?
A: No, by modern definition, 1 is not considered prime. The smallest prime is 2.

Q5: What's the largest prime number known?
A: As of 2024, the largest known prime is 2^82,589,933 − 1, a number with 24,862,048 digits.

Sieve of Eratosthenes Calculator© - All Rights Reserved 2025