arXiv · 2510.16285
A Note on Algorithms for Computing $p_n$
Abstract
We analyze algorithms for computing the $n$th prime $p_n$ and establish asymptotic bounds for several approaches. Using existing results on the complexity of evaluating the prime-counting function $\pi(x)$, we show that the binary search approach computes $p_n$ in $O(\sqrt{n} \, (\log n)^4)$ time. Assuming the Riemann Hypothesis and Cram\'er's conjecture, we construct a tighter interval around li$^{-1}(n)$, leading to an improved sieve-based algorithm running in $O(\sqrt{n} \, (\log ^{7/2} n) \, \log \log n)$ time. This improvement, though conditional, suggests that further refinements to prime gap estimates may yield provably faster methods for computing primes.
Explore related subjects
Keep this discovery
Explore connections, maps & timelines
Ansh Aggarwal. 2025-10-18. A Note on Algorithms for Computing $p_n$. https://arxiv.org/abs/2510.16285
Cite the original work for its findings. Save a collection to share your selection of sources.