TITLE: What is the sum of the reciprocal of primes? (Yes, it diverges..)
QUESTION [12 upvotes]: It's well known that the summation over 1/p diverges just as 1/n does. However, in the case of the sum of 1/n, we can establish upper and lower bounds to the sum with the integrals over 1/n and 1/(n-1). Therefore we can say that the sum is asymptotically equal to ln(x). Can we do anything similar for the sum of the reciprocals of the prime numbers? 
I suspect there isn't a neat function due to the unpredictable distribution of prime numbers.

REPLY [18 votes]: Using $\pi(k)=\frac{k}{\log(k)}\left(1+O\left(\frac1{\log(k)}\right)\right)$,
$$
\begin{align}
\sum_{p\le n}\frac1p
&=\sum_{k=1}^n\frac{\pi(k)-\pi(k-1)}{k}\\
&=\sum_{k=1}^n\frac{\pi(k)}{k}-\sum_{k=0}^{n-1}\frac{\pi(k)}{k+1}\\
&=\frac{\pi(n)}{n}+\sum_{k=1}^{n-1}\frac{\pi(k)}{k(k+1)}\\
&=\frac{\pi(n)}{n}+\sum_{k=1}^{n-1}\frac{\pi(k)}{k^2}-\sum_{k=1}^{n-1}\frac{\pi(k)}{k^2(k+1)}\\
&=\sum_{k=3}^{n-1}\frac{\pi(k)}{k^2}+O(1)\\
&=\sum_{k=3}^{n-1}\left[\frac1{k\log(k)}+O\left(\frac1{k\log(k)^2}\right)\right]+O(1)\\[9pt]
&=\log(\log(n))+O(1)
\end{align}
$$
where we bound the sum by $\int_2^{n-1}\frac{\mathrm{d}x}{x\log(x)}$ and $\int_3^n\frac{\mathrm{d}x}{x\log(x)}$ in the last step.
In fact,
$$
\lim_{n\to\infty}\left(\sum_{p\le n}\frac1p-\log(\log(n))\right)=M
$$
where $M$ is the Meissel–Mertens constant.