Hi everyone,
I’m a programmer by training, and I’ve been working on a new prime sieving algorithm that I’d like to share with this community. It’s called the Modular Projection Sieve, and it reduces working memory to Θ(√N / log N).
The core idea is simple: instead of working with numbers N, work with their index k in the representation N = 6k ± 1. Divisibility p | N becomes a modular condition on k, and the problem transforms into avoiding arithmetic progressions. This leads to a memory reduction to just 53 KB to sieve up to 10⁹.
The algorithm has been formally verified in Lean 4 (self-adjointness of the operator, structural isomorphisms) and the code is available in Python/Numba.
I think there might be potential for GPU acceleration, since the algorithm is highly parallelizable at the index level. However, I’m not an expert in CUDA, so I’d love to hear your thoughts or suggestions.
Any feedback or questions are welcome. Thanks!