Solution (source code)

= Solution

Let $A(x)$ count <primes> $p\le x$ for which $p+2$ is also <prime>. We prove $A(x)\ll x/\log^2x$ using a quadratic <Selberg sieve>, then apply <Abel summation>.

For $F(n)=n(n+2)$, each odd <prime> has exactly two roots modulo that prime. The <Chinese remainder theorem> gives the <polynomial root density in a sieve>
$$
\#\{n\le x:d\mid F(n)\}=xg(d)+O(\rho_F(d)),\qquad g(d)=\frac{2^{\omega(d)}}d,
$$
for odd <squarefree integers> $d$. Put $R=x^{1/8}$ and choose the optimizing real <Selberg sieve weights> $\lambda_d$, supported on these $d\le R$, with $\lambda_1=1$. If $p,p+2$ are prime and $p>R$, their weight $(\sum_{d\mid F(p)}\lambda_d)^2$ is one. It is nonnegative for every other integer. Expanding the square therefore gives
$$
A(x)\le O(R)+x\sum_{d,e\le R}\lambda_d\lambda_e g([d,e])+O\left(\sum_{d,e\le R}|\lambda_d\lambda_e|\rho_F([d,e])\right).
$$
The <Selberg sieve diagonalization> makes the main quadratic form $1/J(R)$, where
$$
J(R)=\sum_{\substack{d\le R\\d\text{ odd and squarefree}}}\prod_{p\mid d}\frac2{p-2}.
$$
The <optimal Selberg weights have modulus at most one>. Since $\rho_F([d,e])\le[d,e]\le R^2$, the remainder is at most $O(R^4)$.

For completeness, the lower bound on $J$ is where the second logarithm enters. Restrict to <primes> $3\le p\le y=R^{1/8}$ and put $k(p)=2/(p-2)$. The full product $W=\prod_{3\le p\le y}(1+k(p))$ is $\asymp\log^2 y$, since its <logarithm> is $2\sum_{3\le p\le y}1/p+O(1)$ and the <Mertens second theorem> applies. Give the associated <squarefree divisor> $d$ probability $k(d)/W$. Prime inclusion probabilities are $2/p$, so the <Mertens first theorem> gives
$$
\mathbb E\log d=2\sum_{3\le p\le y}\frac{\log p}p=2\log y+O(1)<\frac12\log R
$$
for large $R$. The <Markov inequality> shows that at least half the weight has $d\le R$. This proves the <truncated Euler-product lower bound> $J(R)\gg W\gg\log^2R$. Consequently the <twin-prime upper bound from a quadratic sieve> is
$$
A(x)\ll R+\frac{x}{\log^2R}+R^4\ll\frac{x}{\log^2x}.
$$
Finally, <Abel summation> gives
$$
\sum_{\substack{p\le X\\p,p+2\text{ prime}}}\frac1p=\frac{A(X)}X+\int_2^X\frac{A(t)}{t^2}\,dt.
$$
The tail is dominated by $\int_3^\infty dt/(t\log^2t)<\infty$. Thus <reciprocal-sum convergence from a counting bound> proves convergence of the first reciprocal sum. The second is smaller termwise. We have proved <Brun's theorem>:
$$
\boxed{\sum_{p,p+2\text{ prime}}\left(\frac1p+\frac1{p+2}\right)<\infty.}
$$
Counting each twin prime just once changes at most a finite repetition and gives the same conclusion.