TITLE: Primes of the form $n^2+1$ - hard?
QUESTION [43 upvotes]: I met a student that is trying to prove for fun that there are infinitely many primes of the form $n^2+1$. I tried to tell him it's a hard problem, but I lack references. Is there a paper/book covering the problem? Is this problem really hard or I remember incorrectly?

REPLY [10 votes]: If your interested, here is a heuristic argument I just thought up that gives the supposed asymptotic behavior of the number of primes equal to a square plus one less then or equal to a given quanity:
$$\sum_{n\leq x}\Lambda(n^2+1)=\sum_{n\leq x}\sum_{d\mid n^2+1}-\mu(d)\ln(d)=\sum_{n\leq x}\sum_{d\leq x}\sum_{n^2+1\equiv 0 \text{ mod } d}-\mu(d)\ln(d)$$
$$=\sum_{d\leq x}\sum_{n\leq x}\sum_{n^2+1\equiv 0 \text{ mod } d}-\mu(d)\ln(d)=\sum_{d\leq x}\sum_{k=0}^{d-1}\sum_{n\leq \frac{x-k}{d}}\sum_{(dn+k)^2+1\equiv 0 \text{ mod } d}-\mu(d)\ln(d)$$
$$=\sum_{d\leq x}\sum_{k=0}^{d-1}\sum_{n\leq \frac{x-k}{d}}\sum_{k^2+1\equiv 0 \text{ mod } d}-\mu(d)\ln(d)=\sum_{d\leq x}\sum_{k=0}^{d-1}\sum_{k^2+1\equiv 0 \text{ mod } d}-\mu(d)\ln(d)\lfloor{\frac{x-k}{d}}\rfloor$$
$$=\sum_{d\leq x}\sum_{k=0}^{d-1}\sum_{k^2+1\equiv 0 \text{ mod } d}-\mu(d)\ln(d)(\frac{x}{d}+O(1))\approx\sum_{d\leq x}\sum_{k=0}^{d-1}\sum_{k^2+1\equiv 0 \text{ mod } d}-\mu(d)\ln(d)\frac{x}{d}$$
$$=x\sum_{d\leq x}\frac{-\mu(d)\ln(d)f(d)}{d}$$
Where $f(d)$ counts the number of non congruent solutions $k$ modulo $d$ to $k^2\equiv -1 \text{ mod } d$
So that with $\chi$ the non principal character modulo $4$ we have that: $$f(n)=\sum_{d\mid n}\mu(d)^2\chi(\frac{n}{d})\iff\sum_{n=1}^\infty\frac{f(n)}{n^s}=\frac{L(s,\chi)\zeta(s)}{\zeta(2s)}$$
Then perhaps:
$$\sum_{n\leq x}\Lambda(n^2+1)\approx x\lim_{s\to +1}\sum_{d=1}^\infty\frac{-\mu(d)\ln(d)f(d)}{d^s}=x\prod_{p \text{ odd} }(1-\frac{\chi(p)}{p-1})$$
So that we might have:
$$\sum_{\substack{p\leq x\\p=n^2+1}}1\sim  \frac{\operatorname{Li}(x^{1/2})}{2}\left(\prod_{p\equiv 1 \mod 4} \frac{p-2}{p-1}\right)\left(\prod_{p\equiv 3 \mod 4}\frac{p}{p-1}\right)$$