One of my favourite mathematical formula is Mills' formula, published in 1947 in the Bulletin of the American Mathematical Society, Volume 53, Number 6, p604, under the title "A prime-representing function", by W. H. Mills, in 1946:

%% d_n = \lfloor{} A^{3^{n}} \rfloor{} %%

With $$A$$ being a constant, and $$d_{n}$$ being prime for all integers $$n \geq 1$$.

Something that I find fascinating about this formula, is that it's (currently) completely useless, because there is no known way to compute the constant $$A$$ without finding the primes in the first place.

The paper is only one page long and is pretty accessible if you have a background in mathematics. Otherwise, keep on reading for the hand-holding blog post.

The proof relies on a proof by Albert Edward Ingham, published in his 12 page article On the difference between consecutive primes, published in The Quarterly Journal of Mathematics, Oxford Ser. vol. 8 in 1937. As a side note, it's interesting to see that the Oxford University Press is charging EUR €27.00 to access an article written 83 years ago (local mirror). Anyway, here is the formula:

%% \tag{1} p_{n+1} - p_{n} < Kp^{5/8}_{n} %%

Namely, the gap between two primes numbers $$p_{n}$$ and $$p_{n+1}$$ (called the prime gap) is lesser than $$K·p_{n}^{5/8}$$, with $$K$$ being a fixed positive integer.

This boundary has since been reduced to $$p_{n+1} - p_n < K p_n^{1051/1920}$$, by Charles J. Mozzochi, in his paper "On the Difference Between Consecutive Primes", published in the Journal of Number Theory Volume 24, Issue 2, Pages 181-187.

The first lemma of the paper is the following proposition:

If $$N$$ is an integer greater than $$K^{8}$$ there exists a prime $$p$$ such that $$N^3 < p < (N+1)^3 - 1$$.

Let $$p_n$$ be the greatest prime less than $$N^3$$. Then:

%% \begin{aligned} N^3 &\lt p_{n+1} \\ &\lt p_n + Kp_{n}^{5/8} \\ &\lt N^3 + K(N^3)^{5/8} \\ &\lt N^3 + KN^{15/8} \\ &\lt N^3 + N^2 \\ \tag{2} &\lt (N + 1 )^3 - 1 \end{aligned} %%

Let $$P_0$$ be a prime greater than $$K^8$$. Then by the lemma we can construct an infinite sequence of primes, $$P_0, P_1, P_2, ...$$, such that $$P_n^3 < P_{n+1} < (P_n + 1)^3 - 1$$. Let

%% \tag{3} u_n = P^{3 - n}_n, v_n = (P_n + 1)^{3-n}. %%

Then

%% u_n > v_n u_{n+1} = P_{n+1}^{3 - (n+1)} = P_{n+1}^{3 - n - 1} \tag{4} \implies u_{n+1} > u_n, %%

and

%% u_{n+1} = (P_{n+1} + 1)^{3 - (n + 1)} = (P_{n+1} + 1)^{3 - n - 1} \tag{5} \implies v_{n+1} < v_n. %%

It follows at once that the $$u_n$$ form a bounded monotone increasing sequence. Let $$ A = \lim_{n \to \infty} u_n $$.

Theorem: $$ \lfloor{} A^{3^{n}} \rfloor{}$$ is a prime-representing function.

Proof: From $$(4)$$ and $$(5)$$ it follows that $$u_n < A < v_n $$, or $$ P_n < A^{3^n} < P_{n}+1 $$. Therefore $$ \lfloor A^{3^n} \rfloor = P_n $$, and $$ \lfloor{} A^{3^{n}} \rfloor{} $$ is a prime-representing function.

Interestingly, Làszlò Tòth proved in 2017, based on the work of Kuipers and Ansari who generalised this result to $$ \lfloor A^{3^{n}} \rfloor $$, where $$ c ∈ R $$ and $$ C \geq 2.106 $$, that $$ \lceil B^{c^{n}} \rceil $$ is also a prime-representing function.