A Self-Contained Next-Prime Engine: Efficient Computation of Successive Primes

This working paper presents NextPrime, a self-contained algorithm for computing the next prime after a given prime ( p ). The method uses a 6k±1 wheel factorization and deterministic Miller-Rabin primality testing, ensuring correctness for 64-bit integers. We provide a formal correctness proof, analyze time complexity (worst-case O(p⋅(log⁡p)3)O(p \cdot (\log p)^3)O(p \cdot (\log p)^3) , expected O((log⁡p)4)O((\log p)^4)O((\log p)^4) ), and validate performance with unit tests up to the 100,000th prime and benchmarks around p=106p = 10^6p = 10^6 (0.5–1 μs per call). The implementation is included as a supplementary Python module. This work is relevant for applications in cryptography and computational number theory.

Publication Details

Journal
Zenodo (CERN European Organization for Nuclear Research)
Published
2025-04-07
DOI
https://doi.org/10.5281/zenodo.15359831
Primary Topic
Cryptography and Residue Arithmetic
Type
article
Field-Weighted Citation Impact
0.00
Controls
|||
ALL TIME
JAN
FEB
MAR
APR
MAY
JUN
JUL
AUG
SEP
OCT
article

A Self-Contained Next-Prime Engine: Efficient Computation of Successive Primes

Zenodo (CERN European Organization for Nuclear Research)
Cryptography and Residue Arithmetic
article

A Self-Contained Next-Prime Engine: Efficient Computation of Successive Primes

article en

Abstract

This working paper presents NextPrime, a self-contained algorithm for computing the next prime after a given prime ( p ). The method uses a 6k±1 wheel factorization and deterministic Miller-Rabin primality testing, ensuring correctness for 64-bit integers. We provide a formal correctness proof, analyze time complexity (worst-case O(p⋅(log⁡p)3)O(p \cdot (\log p)^3)O(p \cdot (\log p)^3) , expected O((log⁡p)4)O((\log p)^4)O((\log p)^4) ), and validate performance with unit tests up to the 100,000th prime and benchmarks around p=106p = 10^6p = 10^6 (0.5–1 μs per call). The implementation is included as a supplementary Python module. This work is relevant for applications in cryptography and computational number theory.

Zenodo (CERN European Organization for Nuclear Research)
Openalex Percentile: Top 42%
Cryptography and Residue Arithmetic
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.

A Self-Contained Next-Prime Engine: Efficient Computation of Successive Primes · Zenodo (CERN European Organization for Nuclear Research) (2025) | TGRS Research Map | TGRS