A Note on Algorithms for Computing pn

Abstract

We analyze algorithms for computing the nth prime pn and establish asymptotic bounds for several approaches. Using existing results on the complexity of evaluating the prime-counting function π(x), we show that the binary search approach computes pn in O(n \, ( 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(n \, ( 7/2 n) \, n) time. This improvement, though conditional, suggests that further refinements to prime gap estimates may yield provably faster methods for computing primes.

0

Turn this paper into a full lesson

ArcXiv compiles a staged curriculum from this paper: 8-12 lessons across beginner → advanced, synthesised section guides, visuals, flashcards, a quiz, exercises, and on-demand deep dives per section. Grounded in the abstract, never invented.

Discussion (0)

Sign in to join the discussion.

Loading comments…