# Alternating sum of primes.

Do we know the sum, $$\sum_p \frac{\chi\left(p\right)}{p}\textrm{?}$$ for $$\chi\left(n\right)$$ being $$1$$ if $$n=1\textrm{ mod }4$$, $$-1$$ if $$n=3\textrm{ mod }4$$ and zero otherwise.

I'm looking for an exact value, if there is one, and a derivation.

• I strongly doubt that this sum has a nice closed form. – Peter Sep 19 '19 at 12:51
• You should know from the Euler product for $L(s,\chi)$ that there is never a closed-form for $\sum_p \frac{\chi(p)}{p}$, only for $\log L(1,\chi)=\sum_{p^k} \frac{\chi(p^k)}{k p^k}$ when $\chi(-1) = -1$ and for $\log L(2,\chi)$ when $\chi(-1)=1$ – reuns Sep 19 '19 at 14:12

Since $$|\chi(p)|\leq 1$$, we may approximate $$\frac{\chi(p)}{p}$$ with $$-\log\left(1-\frac{\chi(p)}{p}\right)$$ and deduce that $$\sum_{p}\frac{\chi(p)}{p} \approx \log\prod_{p}\left(1-\frac{\chi(p)}{p}\right)^{-1}=\log L(1)=\log\frac{\pi}{4}$$ where $$L(s)$$ stands for the Dirichlet $$L$$-function $$L(s)=\sum_{n\geq 1}\frac{\chi(n)}{n^s}$$. With the same mechanism leading to a series representation for the prime $$\zeta$$ function (i.e. Moebius' inversion formula) we may state that
$$\sum_{p}\frac{\chi(p)}{p} = \sum_{n\geq 1}\mu(n)\frac{\log L(n)}{n}$$ where the series on the RHS has a reasonable convergence speed, due to $$L(n)\approx 1-\frac{1}{3^n}\Rightarrow\log L(n)\approx -\frac{1}{3^n}$$. Numerically we have $$\sum_{p}\frac{\chi(p)}{p}\approx -0.18654766883298535284.$$
• Then, it would seem that from a certain perspective, there are "slightly" more primes of the $4n + 3$ form than those of the $4n + 1$ form. Beautiful mystery! – Piquito Sep 19 '19 at 13:29