TITLE: What's the fastest growing function known to contain infinitely many primes?
QUESTION [24 upvotes]: I know that Dirichlet's Theorem says that for every $a,b\in\mathbb{N}$ with $\gcd(a,b)=1$ and $a\ge 1$ the function
\begin{align*}
f:\mathbb{N}&\to\mathbb{N}\\
n&\mapsto an+b
\end{align*}
evaluates to a prime number for infinitely many $n\in\mathbb{N}$. However, we don't know whether there are any quadratic polynomials containing infinitely many prime numbers. This made me wonder:

What is the fastest growing non-decreasing function $f:\mathbb{N}\to\mathbb{N}$, for which $f(n)$ is computable in $O(\log n)$ and $\{f(n):n\in\mathbb{N}\}$ is known to contain infinitely many primes?

REPLY [4 votes]: Using 
Baker, R.C.; Harman, G.; Pintz, J., The difference between consecutive primes. II, Proc. Lond. Math. Soc., III. Ser. 83, No.3, 532-562 (2001). ZBL1016.11037.,
in every interval of the form $[x - x^{21\over 40}, x]$ there is at least one prime number, for sufficiently large $x$. Therefore the elegant answer by Robert Israel can be adapted and improved by mapping all intervals of $\mathbb N$ of the form $[2^{21n},2^{22n}]$ into $[2^{40n}-2^{21n}, 2^{40n}]$ via addition of $2^{40n}-2^{22n}$ and defining the function elsewhere arbitrarily up to monotonicity. This yields a monotonic function which is $O(n^{40/21})$ and contains infinitely many primes. (Given the Riemann Hypothesis, this can be improved slightly to a quadratically increasing function.)