arXiv · 2612.05929
Enumerating the First $k$ Primes in Deterministic $O(k)$ Time
Abstract
We give a deterministic word-RAM algorithm that lists the primes up to $n$ in increasing order in $O(n/\log n)$ worst-case time. Consequently, the first $k$ primes can be generated in $O(k)$ total time, with worst-case $O(1)$ delay between outputs for a requested $k$ using algorithm-owned buffers. The algorithm starts from Harvey's parity formula for prime enumeration and computes a packed linear syndrome for each small block rather than the full output of the convolutions. Exact prime counts at large-block boundaries certify the sparse decodings and detect the few large blocks in which sparse recovery fails, allowing those blocks to be recomputed directly without locating individual errors.
Explore related subjects
Keep this discovery
Explore connections, maps & timelines
Xiangle Chen. 2026-12-03. Enumerating the First $k$ Primes in Deterministic $O(k)$ Time. https://searcharxiv.org/abs/2612.05929
Citations retain the original authors and DOI and include this site’s record URL. If this discovery service contributed to your research, you can also cite Search arXiv by Indiciae: BibTeX · RIS.