# Is there numerical evidence supporting the predicted density of the primes of the form $x^2+1$?

A famous conjecture (due I think to Hardy and Littlewood) states that if $P(x)$ denotes the number of primes of the form $n^2+1$ less than or equal to $x$, then $$P(x)\sim \frac{C\sqrt x}{\log x}$$ for some constant $C$ (their Conjecture F gives an expression for $C$, which I think is predicted to be somewhere in the area of $2$, although I'm not confident of that.

However, having calculated the first $1.35$ million such primes, it is not at all obvious that this is accurate. My question is the following: is there substantial numerical evidence which supports the conjecture? If so, is it simply not apparent until much higher values, or are my calculations wrong?

• Slightly related: math.stackexchange.com/questions/879729 – punctured dusk Apr 1 '15 at 13:52
• See numerical data for the Bateman-Horn conjecture. – Dietrich Burde Apr 1 '15 at 13:57
• According to the prime number theorem, the number of primes of the form $x+1~($and, of course, all primes can be written in this trivial form$)$ is $\dfrac x{\ln x}$ . Replacing x with $x^2$ we have $\dfrac{\sqrt x}{\ln\sqrt x}~=~\dfrac{2~\sqrt x}{\ln x}$ . Similarly for other primes of the form $p=x^n+a$, assuming such an expression is irreducible and a is an integer. – Lucian Apr 1 '15 at 13:59
• @Lucian Unfortunately, I don't think that can work, since, if given a prime $x+1$, $x^2+1$ is not necessarily prime. – Laertes Apr 1 '15 at 17:52
• @Laertes: No one said that it is, but this is the basic idea. – Lucian Apr 1 '15 at 17:58

Up to $10^{24}$ there are $25814570672$ primes of the form $n^2+1,$ and the formula with $C=1.3728134628182\ldots$ predicts $24841887983$ (3.9% error). You can get better by replacing $C\sqrt x/\log x$ with $C\operatorname{li}(\sqrt{x})/2$ which gives $25814350227$ (0.00085% error). Note that $C\sqrt x/\log x \sim C\operatorname{li}(\sqrt x)/2.$
You mentioned the first 1.35 million primes of the form $n^2+1.$ The 1.35 millionth prime of that form is $1016179851635777$, and the two functions predict 1.266450 million and 1.350213 million, respectively -- not bad at all.