Deterministic construction of an n-bit prime in time polynomial in n (current best 2^(n/2+o(n)))
Difficulty 76: a concrete derandomisation target that has resisted strong teams (Polymath4) and sits against the square-root barrier of analytic number theory; the 2023 pseudodeterministic construction shows progress on a weaker notion, but a deterministic polynomial-time algorithm still needs either Cramér-level prime gaps or a derandomisation of BPP-type strength. Application value 6: marginal, since random primes are used in practice. Leverage 30: limited to derandomisation theory and analytic number theory.
The problem
Without using any randomness, can a computer quickly produce a big prime number whenever you ask?
- 1Random guess then test finds primes fast
- 2Can we avoid randomness entirely?
- 3Best proven recipe takes about √N time
- 4Polymath4 tried and fell short
- 5Open: fast fixed recipe for primes
The problem. Given , output a prime in by a deterministic algorithm. A randomised algorithm picks random integers and tests primality (Miller–Rabin, or deterministically by Agrawal, Kayal and Saxena, 2004). By the prime number theorem the density of primes near is about , so the expected running time is .
Path to understanding
foundations → problemThe research entries this problem rests on, in the order to read them. Each links to its explainer.
- Start with
- Step 2
- Computational complexity theoryTheory · host
- Then
- Deterministic construction of an n-bit prime in time polynomial in n (current best 2^(n/2+o(n)))The problem
State of the art
Best known. Brute-force testing takes . The unconditional state of the art, due to Odlyzko and Lagarias–Odlyzko (computing by an analytic method), takes time to find a prime in . The Polymath4 project (2009–2010; Tao, Croot, Helfgott and other participants; arXiv:1009.3956, published in Math. Comp. 2012) aimed to beat the square-root barrier, and obtained partial results (for example computing the parity of the number of primes in an interval in about the same time) but did not break the barrier. Under the Riemann Hypothesis, prime gaps are at most , which gives the same exponent; Cramér's conjecture (gaps ) would give polynomial time but is unproven. A full derandomisation of (which follows from Impagliazzo–Wigderson-type circuit lower bounds) would give a polynomial-time algorithm.
Realistic applications
A deterministic polynomial-time prime constructor would give the first unconditional derandomisation of an important randomised search problem and remove a randomness requirement in cryptographic key generation (a theoretical point only; random primes are used in practice). Partial progress with would require new ideas in analytic number theory.
What counts as solved
Full resolution: a deterministic algorithm that on input outputs an -bit prime in time , with proof. Partial progress: any deterministic algorithm beating the square-root barrier, i.e. time for a fixed , or a pseudodeterministic polynomial-time construction that works for every .
How it gets verified
Expert reviewOnly expert review of the argument is possible today.
The claim is a deterministic polynomial-time algorithm that outputs an n-bit prime for every n, which needs a running-time proof. Mathlib has polynomial-time Turing machines (TM2ComputableInPolyTime) and Formal Conjectures defines IsPolyTime (Computability/Complexity.lean), so the statement could be written, but no Lean statement of it exists (Formal Conjectures pinned at commit e754a78 (17 October 2026)). Experts verify the proof; outputs for specific n are easy to check by primality testing but say nothing about the running time.
Claims under verification
+ add a claimNo claimed results on the Verification board for this problem yet.
Where the work is
Analytic number theory and complexity proof; computation can verify prime gaps but not the asymptotic claim.
Bottlenecks
ranked by votes- #1TheorySquare-root barrier
Algorithms based on counting primes by analytic formulae need x^{1/2}-type resolution, matching the RH-conditional prime-gap bound; no method bypasses it.
Community grades
Sign in to add your own grade.
Connected problems
Progress
- May 24, 2023Pseudodeterministic polynomial-time primessource
Chen, Lu, Oliveira, Ren and Santhanam constructed canonical n-bit primes in randomised polynomial time for infinitely many n (FOCS 2023; J. ACM 2026).
- Sep 1, 2010Polymath4 papersource
The project reported partial results; the square-root barrier remained.
- Aug 9, 2009Polymath4 beginssource
A collaborative project started on finding primes deterministically in time below N^(1/2).
- Sep 1, 2004Deterministic primality testsource
Agrawal, Kayal and Saxena gave a deterministic polynomial-time primality test.