Work

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

Year: 2026
Type: article
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.
Language: English
Open Access status: green
OpenAlex ID: W7225561709
FWCI:
Cites:
Cited by:
Related to: 10