Skip to content
DARC
■ Change #122 · wiki.edited

Deterministic construction of an n-bit prime in time polynomial in n (current best 2^(n/2+o(n))): Normalize Markdown to canonical form

by DARC wiki2026-10-22 20:31:13 UTCOpen the page →
body
− Given $N=2^n$, output a prime in $[N,2N]$ by a deterministic algorithm. A randomised algorithm picks random integers and tests primality (Miller–Rabin, or deterministically by Agrawal–Kayal–Saxena, 2004): its expected running time is $\mathrm{poly}(n)$ because primes have density $\sim 1/\ln N$. *Is there a deterministic algorithm running in time $\mathrm{poly}(n)$, i.e. $(\log N)^{O(1)}$?* The best unconditional algorithm takes $N^{1/2+o(1)}$ time, exponential in $n$. The problem is a clean test case for derandomisation: it is a search problem in a dense set whose density is known.
+ Given $N=2^n$, output a prime in $[N,2N]$ by a deterministic algorithm. A randomised algorithm picks random integers and tests primality (Miller–Rabin, or deterministically by Agrawal–Kayal–Saxena, 2004): its expected running time is $\mathrm{poly}(n)$ because primes have density $\sim 1/\ln N$. _Is there a deterministic algorithm running in time $\mathrm{poly}(n)$, i.e. $(\log N)^{O(1)}$?_ The best unconditional algorithm takes $N^{1/2+o(1)}$ time, exponential in $n$. The problem is a clean test case for derandomisation: it is a search problem in a dense set whose density is known.
explainer.student
− **The problem.** Given $N=2^n$, output a prime in $[N,2N]$ 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 $N$ is about $1/\ln N$, so the expected running time is $\mathrm{poly}(n)$. *Is there a deterministic algorithm running in time $\mathrm{poly}(n)$, i.e. $(\log N)^{O(1)}$?*
+ **The problem.** Given $N=2^n$, output a prime in $[N,2N]$ 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 $N$ is about $1/\ln N$, so the expected running time is $\mathrm{poly}(n)$. _Is there a deterministic algorithm running in time $\mathrm{poly}(n)$, i.e. $(\log N)^{O(1)}$?_
The best unconditional algorithm takes $N^{1/2+o(1)}$ time, exponential in $n$. The problem is a clean test case for **derandomisation**: a search problem in a dense set, where the density is known and primality testing is already deterministic.
**State of the art.**
- Brute-force testing of every number in the interval takes $N^{1+o(1)}$ time.
- Odlyzko and Lagarias–Odlyzko (analytic methods for computing the prime counting function $\pi(x)$) find a prime in $[N,2N]$ in $N^{1/2+o(1)}$ time. This is the best known unconditionally.
− - The Polymath4 project (2009-10; Tao, Croot, Helfgott and others) aimed to beat the square-root barrier, obtaining partial results such as computing the parity of the number of primes in an interval in about the same time, but did not break the barrier. Its write-up appeared in *Mathematics of Computation* (2012).
+ - The Polymath4 project (2009-10; Tao, Croot, Helfgott and others) aimed to beat the square-root barrier, obtaining partial results such as computing the parity of the number of primes in an interval in about the same time, but did not break the barrier. Its write-up appeared in _Mathematics of Computation_ (2012).
- Under the Riemann Hypothesis, prime gaps are at most about $\sqrt N\log N$, which gives the same exponent. Cramér's conjecture (gaps of size about $\log^2 N$) would give polynomial time but is unproven. A full derandomisation of BPP, which would follow from strong circuit lower bounds, would also give a polynomial-time algorithm.
- Chen, Lu, Oliveira, Ren and Santhanam (2023) gave a randomised algorithm that, for infinitely many lengths $n$, outputs one fixed prime with high probability (a "pseudodeterministic" construction). Making it work for every $n$, and removing the randomness, remain open.
**Connections.** Derandomising polynomial identity testing is related, and a general theory of pseudorandomness (hardness versus randomness) would give deterministic constructions of objects that random choice produces easily, including primes, if strong circuit lower bounds hold. So a proof from complexity assumptions is plausible, but the unconditional statement is open.
**Why it is hard.** Primes are defined multiplicatively and appear additively spread out; no known method guarantees one in a short interval short of the square-root length, except by counting. Any approach must either count primes faster or understand their distribution in short intervals far better than known.
**Payoff.** Mostly theoretical; it would be a landmark in derandomisation and would likely need new ideas in number theory.
hash 6d1e313d6fe229c384a663d7f62c49c3769fb4d3e89ee3ba83708e373339b693
previous 334d9663e635493eed73b2f584690cc2869fe8815a5453fcfd3c5c635de64dd1