Let count primes for which is also prime. We prove using a quadratic Selberg sieve, then apply Abel summation.
For , each odd prime has exactly two roots modulo that prime. The Chinese remainder theorem gives the polynomial root density in a sieve
for odd squarefree integers . Put and choose the optimizing real Selberg sieve weights , supported on these , with . If are prime and , their weight is one. It is nonnegative for every other integer. Expanding the square therefore gives
The Selberg sieve diagonalization makes the main quadratic form , where
The optimal Selberg weights have modulus at most one. Since , the remainder is at most .
For completeness, the lower bound on is where the second logarithm enters. Restrict to primes and put . The full product is , since its logarithm is and the Mertens second theorem applies. Give the associated squarefree divisor probability . Prime inclusion probabilities are , so the Mertens first theorem gives
for large . The Markov inequality shows that at least half the weight has . This proves the truncated Euler-product lower bound . Consequently the twin-prime upper bound from a quadratic sieve is
Finally, Abel summation gives
The tail is dominated by . 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:
Counting each twin prime just once changes at most a finite repetition and gives the same conclusion.