While playing around with prime gaps, I found out that the following formula seems to be a rather good approximation of the ratio $\dfrac{p_{b}-p_{a}}{b-a}$ where $a<b$ are positive integers:

$$H_{m}-\log_{2} m-2\gamma$$

where $m:=\frac{a+b}{2}$, $\gamma$ is Euler-Mascheroni's constant, $\log_{2}x=\log\log x$ and $H_{x}=\{x\}H_{\lceil x\rceil}+(1-\{x\})H_{\lfloor x\rfloor}$ is a rather natural generalization of harmonic numbers.

Writing $\dfrac{p_{b}-p_{a}}{b-a}=H_{m}-\log_{2} m-2\gamma+R_{m}$, is it true that $R_{m}=O_{\varepsilon}(\dfrac{1}{m^{1/2+\varepsilon}})$?

• Setting $b=a+1$, this would imply $p_{n+1}-p_n = (1+o(1)) \log n$, which is known to be false by known results on large or small gaps between primes (the first result on the former by Westzynthius in 1931, the first (unconditional) result on the latter by Erdos in 1940). – Terry Tao Jan 22 '15 at 18:21
• The claim is also inaccurate in the opposite extreme $a=1$, as it would imply that $p_n = n \log n - n \log \log n - \gamma n - n \log 2 + o(n)$, whereas the prime number theorem in fact gives $p_n = n \log n + n \log \log n - n + o(n)$ (Cesaro, 1894). – Terry Tao Jan 22 '15 at 18:31
• Also, the approximation is poor when a=1, as the prime number theorem gives the left hand side is close to log b, while the right hand side is close to log (b/2). Gerhard "Primes Seem Even More Gappy" Paseman, 2015.01.22 – Gerhard Paseman Jan 22 '15 at 18:33
• Is it a common notation to write $\log_2$ for $\log\log$? I've never seen such. – Yaakov Baruch Jan 22 '15 at 19:02
• @YaakovBaruch: It is common to use this notation where higher iterates of log frequently occur, e.g. in certain branches of number theory and combinatorics. For example, Maynard's paper (arxiv.org/abs/1408.5110) uses this notation. – GH from MO Jan 22 '15 at 19:07

Even the weaker statement that $\frac{p_b-p_a}{b-a}$ tends to infinity with $a,b\to\infty$ is false, because there are infinitely many bounded prime gaps (Yitang Zhang's theorem).
• I think you need Maynard's theorem for this unless $|b-a|=1.$ – Charles Mar 9 '15 at 19:41
• @Charles: Yes, but $b=a+1$ and $a\to\infty$ is enough to falsify the "weaker statement that $\frac{p_b-p_a}{b-a}$ tends to infinity with $a,b\to\infty$". So what I said was correct, although Terry Tao's comment (below the OP's post) is a better answer, because it uses much less. – GH from MO Mar 10 '15 at 6:02
Just out of curiosity - here is the plot of $\frac{p_{n+h}-p_n}h$ for $1\leqslant n,h\leqslant500$