# Sieve of Eratosthenes (Prime List Generator)

Enumerate primes up to 10⁷ (or within [m, n]) with the classic sieve; shows base primes, crossing-out operations, exact counts, and up to 200 primes.

> Canonical page: https://elysiatools.com/en/tools/sieve-of-eratosthenes

- **Category:** Math & Numbers

- **Keywords:** sieve of eratosthenes, prime numbers, prime list, prime generator, prime counting, composite numbers, number theory

## Overview

The Sieve of Eratosthenes generator enumerates prime numbers up to 10⁷ or within a custom interval [m, n]. It calculates prime counts, identifies base primes, and tracks composite cross-out operations to demonstrate the inner mechanics of the classic algorithm.

## Inputs

- **Upper limit n** (text): Sieve bound, 2 ≤ n ≤ 10⁷ (byte-sieve limit).
- **Lower bound m (optional)** (text): Only list primes ≥ m; leave empty to enumerate from 2.

## When to use

- You need an exact count of primes (π(n)) or a list of prime numbers up to 10⁷.
- You want to inspect prime numbers within a specific range \[m, n\].
- You are studying or teaching number theory and want to see base primes (p² ≤ n) and composite cross-out counts.

## How it works

- Enter an upper sieve bound n between 2 and 10⁷, and optionally enter a lower bound m.
- The algorithm sifts numbers by finding base primes whose squares do not exceed n (p² ≤ n).
- Multiples of each base prime are marked as composites through iterative cross-out operations.
- The tool outputs the list of surviving primes (up to 200 items), total prime counts, and cross-out operation statistics.

## Use cases

- Verifying prime density and calculating the prime counting function π(n) for math homework or research.
- Generating prime lists within specific numerical ranges for cryptographic and hashing experiments.
- Analyzing the algorithmic efficiency of the Sieve of Eratosthenes by comparing composite counts against total cross-out operations.

## Frequently asked questions

### What is the maximum limit for n in this tool?

The upper bound n can be set up to 10,000,000 (10⁷).

### How many primes are displayed in the output?

The output displays up to 200 prime numbers, but the prime counting function π(n) remains exact regardless of list length.

### What does the optional lower bound m do?

It filters the final prime list to only show primes greater than or equal to m, while the sieve continues to compute from 2 up to n.

### What are base primes in the output?

Base primes are primes satisfying p² ≤ n whose multiples must be crossed out to identify all composite numbers up to n.

### Why does the tool show crossing-out operation counts?

It quantifies the work done by each base prime to show how composites are systematically marked and removed.

## Related tools

- [Permutation / Combination / Subset Generator (With Repeats)](https://elysiatools.com/en/tools/combinatorial-generation): Deduplicated, lexicographic permutations / combinations / subsets of up to 12 items with exact multiset counts; display capped at 200 entries.
- [Three-Phase Short-Circuit Current Calculator (IEC 60909)](https://elysiatools.com/en/tools/short-circuit-current-calculator): Estimate the three-phase symmetric short-circuit current using the IEC 60909 far-from-generator method: I"_k = c·U_n/(√3·|Z|) and i_p = κ·√2·I"_k with κ = 1.02 + 0.98·e^(−3R/X). Source impedance is the series sum of transformer and line R/X.
- [Carmichael Function λ(n) Calculator](https://elysiatools.com/en/tools/carmichael-function): Group exponent λ(n) from prime factorization with φ(n) comparison, primitive-root existence, Korselt's Carmichael-number detection, and optional sample-unit verification.
- [Chinese Remainder Theorem Solver (System of Congruences)](https://elysiatools.com/en/tools/chinese-remainder-theorem): Generalized pairwise-merge CRT for 2–20 congruences: coprime moduli give the product modulus, consistent non-coprime moduli give the lcm, inconsistent systems are rejected.
- [Euler Totient Function φ(n) Calculator](https://elysiatools.com/en/tools/euler-totient-function): Exact φ(n) from trial-division factorization (n ≤ 10¹²) with optional coprime listing and Euler's theorem recall.
- [Fraction Decimal Converter](https://elysiatools.com/en/tools/fraction-decimal-converter): Convert between fractions and decimals with support for mixed numbers, improper fractions, and various decimal formats
- [Zero-Sum Game Solver (Saddle Point / Linear Programming)](https://elysiatools.com/en/tools/game-theory-zero-sum): Two-person zero-sum games: saddle-point test first, then mixed strategies from a single-phase simplex LP with dual shadow prices, verified by security-level checks.
- [Inverse Laplace Transform Calculator (Partial Fractions)](https://elysiatools.com/en/tools/inverse-laplace-calculator): Partial-fraction inverse Laplace transform for proper rational functions: root factorization (real + conjugate pairs), exact coefficient system, term-by-term inversion.

## Samples

- [Web Image Processing Python Samples](https://elysiatools.com/en/samples/web-image-processing-python): Web Python image processing examples using PIL/Pillow including reading, saving, resizing, and format conversion
- [Android Image Processing Java Samples](https://elysiatools.com/en/samples/android-image-processing-java): Android Java image processing examples including reading/saving images, scaling, and format conversion
- [Android Image Processing Kotlin Samples](https://elysiatools.com/en/samples/android-image-processing-kotlin): Android Kotlin image processing examples including reading/saving images, scaling, and format conversion
- [Web Image Processing Rust Samples](https://elysiatools.com/en/samples/web-image-processing-rust): Web Rust image processing examples including image read/save, scaling, and format conversion
