Formalizing the "no formula for primes" intuition I was trying to formalize the intuition is that there is no formula for primes, and this is my best attempt:

Conjecture: There is no $O(n^2)$ expected time randomized algorithm to generate $\ge n$-bit primes.

Currently I believe the best algorithm has conjectured complexity $\tilde{O}(n^3)$: run the $\tilde{O}(n^2)$ Lucas-Lehmer test on $O(n)$ Mersenne numbers.  We could go from $n^3$ to $n^2$ using the same sample-and-check strategy if a faster $\tilde{O}(n)$ checking algorithm is found.  (This argument for the choice of 2 as exponent due to Paul Christiano.)

However, if a "formula for primes" existed, and was sufficiently simple, the fact that arithmetic is quasilinear means that we might get a quasilinear time prime generation algorithm, or $\tilde{O}(n)$.  Conjecturing that the minimum exponent is 2 roughly approximates "the best strategy is sample-and-check".

Two questions:


Is there any heuristic evidence beyond the algorithms discovered so far about the optimum primality testing exponent, or the optimal exponent for generating primes?
Are there other attempts at formalizing the "no formula for primes" intuition?


I should clarify that of course I know that settling the conjecture is hopeless: I’m looking for heuristics only.
[Certainly not a complete answer, but too long for a comment]

Testing whether a given DFA accepts the base-2 representation of at least one prime number is not known to be computable. If it were uncomputable, that's some kind of weak evidence that there's no "regular-ish" formula for primality. (I mean, we know the set of primes itself is not regular, but here it's about whether there's a formula that's sufficiently simple that you could use it to help decide whether a given DFA accepts any primes.)

In another direction, given that your conjecture is about the difference between cubic and quadratic, it might be reasonable to think about whether the problem is complete for cubic time under sub-cubic reductions (see Vassilevska Williams &amp; Williams). It looks tricky, or even unlikely, since it's so different from the other "cubic-complete" problems, like all-pairs shortest paths, triangle detection, etc., but could be worth considering nonetheless. Their framework was in the context of deterministic algorithms, but it shouldn't be too hard to adapt to randomized...