DevTrendsDeveloper trends
Accent color

Product

Primeward – Exploring a stateful recurrence for the next prime

I’ve published Primeward, a Python research prototype. I started with a question: can we calculate the next prime from what we already know, rather than find it by brute force? The implementation builds on known next-pri…

DTResearch & learning

About

I’ve published Primeward, a Python research prototype. I started with a question: can we calculate the next prime from what we already know, rather than find it by brute force? The implementation builds on known next-prime formulas. It uses a finite bound and interval arithmetic to extract the exact next prime from a stored arithmetic state, then updates that state and repeats. It uses the Riemann zeta function and Euler products without assuming the Riemann Hypothesis. The repo includes the implementation, an optimized version, correctness tests, sieve baselines, benchmarks, and research notes. It’s currently slower than sieving. Building the initial state and maintaining enough numerical precision are expensive. I want to see how much we can reduce those costs while still calculating the exact next prime. I’m interested in related work and ideas for reducing those costs. github.com/alexhraber/primeward

Discovery history

  1. Show HN

    Nov 21, 2026 · 1 observations

Discuss this product