The Sieve of TimoEratosthenes: an incremental, division-free prime sieve on the line y = 2x + 1

The Sieve of TimoEratosthenes is an incremental algorithm for generating prime numbers by walking the line y = 2x + 1. For each prime p, the algorithm maintains a single value, ForwardX, representing the next position at which an odd multiple of p occurs. A candidate is composite if one or more ForwardX values reach its position. Otherwise, it is prime. Each prime advances its ForwardX by p. The algorithm generates primes incrementally without requiring a predefined upper limit. It uses addition and comparison in its main loop, with one multiplication when a new prime is discovered. It can be stopped, saved and resumed. This paper presents the mathematical formulation, a proof of correctness, a circular bucket-array implementation, a postponed variant with resumable state, and a wheel optimization that skips multiples of 3, 5 and 7. An open-source C# implementation is verified against independent reference calculations and benchmarked against classic, segmented and trial-division methods. The results show that the Sieve of TimoEratosthenes offers an alternative approach to prime generation, particularly when incremental operation, resumability and low memory consumption are important.

Authors

Publication Details

Journal
Zenodo (CERN European Organization for Nuclear Research)
Published
2026-11-08
DOI
https://doi.org/10.5281/zenodo.24056002
Primary Topic
Analytic Number Theory Research
Type
article
Field-Weighted Citation Impact
0.00
Controls
|||
ALL TIME
JAN
FEB
MAR
APR
MAY
JUN
JUL
AUG
SEP
OCT
NOV
article

The Sieve of TimoEratosthenes: an incremental, division-free prime sieve on the line y = 2x + 1

Timo Kinnunen
1 links
Zenodo (CERN European Organization for Nuclear Research)
Analytic Number Theory Research
article

The Sieve of TimoEratosthenes: an incremental, division-free prime sieve on the line y = 2x + 1

Timo Kinnunen
article en

Abstract

The Sieve of TimoEratosthenes is an incremental algorithm for generating prime numbers by walking the line y = 2x + 1. For each prime p, the algorithm maintains a single value, ForwardX, representing the next position at which an odd multiple of p occurs. A candidate is composite if one or more ForwardX values reach its position. Otherwise, it is prime. Each prime advances its ForwardX by p. The algorithm generates primes incrementally without requiring a predefined upper limit. It uses addition and comparison in its main loop, with one multiplication when a new prime is discovered. It can be stopped, saved and resumed. This paper presents the mathematical formulation, a proof of correctness, a circular bucket-array implementation, a postponed variant with resumable state, and a wheel optimization that skips multiples of 3, 5 and 7. An open-source C# implementation is verified against independent reference calculations and benchmarked against classic, segmented and trial-division methods. The results show that the Sieve of TimoEratosthenes offers an alternative approach to prime generation, particularly when incremental operation, resumability and low memory consumption are important.

Zenodo (CERN European Organization for Nuclear Research)
Analytic Number Theory Research
AI Navigator

Ask Laika to Summarize, Analyze, and Connect papers live on the map.

Summarize Papers & Methodologies

Extract key findings, datasets, and comparative methods across publications.

Benchmark Rankings & Visual Analytics

Rank top research institutions, authors, funders, topics, and journals by Field-Weighted Citation Impact (FWCI) and paper volume with instant charts.

Connect Distant Disciplines

Bridge topological clusters on the map to find hidden collaborative intersections.

Laika access coming soon