About Brun's Theorem http://arxiv.org/pdf/1401.7555.pdf
On the page 8 there is a proof of Brun's theorem.
$$\large-\int_1^{\infty}\pi_2(x)\;\mathrm{d}\left(\frac1{\lfloor x \rfloor}\right)=-\sum_{n\ge 1}\pi_2(n)\left(\frac1{n+1}-\frac1{n}\right)=\sum_{n\ge 1}\frac{\pi_2}{n^2}$$
I didn't understand this. Can someone explain to me this equations step by step? What is the derivative of floor function and integral of twin prime counting function?
 A: The first equality is just writing down what Riemann-Stieltjes integration is. Because that's not very helpful in itself, let's quickly look at that.
Usually, we think of $\displaystyle \int_a^b f(x) \mathrm{d}x$ as a limit of sums of the form $\displaystyle \sum_j f(x_j)(x_{j+1} - x_j)$, where the $x_j$ are some partition of the interval $[a,b]$. We might similarly define $\displaystyle \int_a^b f(g) \mathrm{d}(g(x))$ to be a limit of sums of the form $$\displaystyle \sum_j f(x_j)\left(g(x_{j+1}) - g(x_j)\right). \tag{1}$$ The idea here is that we only take values of $f$ when the measuring function $g$ is changing, proportional to the change of $g$. Notice that if $g(x) = x$, the identity function, then this sort of integration is the exact same as the "normal" sort. A bit of trivia: $f$ is still called the "integrand", and now $g$ is called the "integrator."
We call this Riemann-Stieltjes integration, as Stieltjes came up with it as a generalization of Riemann integration. It has the disadvantage of being less intuitive - it's no longer just the "area under the curve", but it has the advantage of possessing essentially every property of the normal Riemann integral with almost the exact same proof. (In this sense, it's sort of a stepping stone between Riemann integrals and more general integrals against a general measure, like the Lebesgue integral). In the proof in the article, we used integration by parts to get to the chain of equalities you are asking about.
Now, to answer your question directly. We want to understand how
$$ \int_1^\infty \pi_2(x) \mathrm{d}\left( \frac{1}{\lfloor x \rfloor} \right) = \sum_{n \geq 1} \pi_2(n) \left( \frac{1}{n+1} - \frac{1}{n} \right).$$
So we ask, when does $\dfrac{1}{\lfloor x \rfloor}$  change values? It's constant except when $x$ is an integer, where it has a jump discontinuity. In a small neighborhood of $n+1$, the function $\dfrac{1}{\lfloor x \rfloor}$ changes from the value $\dfrac{1}{n}$ to $\dfrac{1}{n+1}$ (and is constant until the next integer on either side). Then Riemann-Stieltjes integration means that the integral in that neighborhood has the value $\pi_2(n)\left(\dfrac{1}{n+1} - \dfrac{1}{n}\right)$. Go back and compare this to $(1)$ above - it should make sense.
This is true at every integer in the integral, so we sum them together, and this gives us the equality. I suppose we just took the integral.
The second equality you ask about it far simpler. Notice that $-\left(\dfrac{1}{n+1} - \dfrac{1}{n}\right) = \dfrac{1}{n(n+1)} < \dfrac{1}{n^2}$. This gives the second (in)equality.
As I mentioned in a comment above, I wrote that article, and I'm happy to answer any questions you have (and always surprised that anyone reads anything I've written).
