Finding an upper bound using summation by parts I'm trying to understand the proof of a lemma by Jacques Peyrière (Calculs de dimensions de Hausdorff).
Consider a sequence $(a_n)_{n\geq 1}$, where $a_n\in\{2,3,\ldots\}$ for all $n$. We define $F_{n}=[1,n]\cap\mathbb{N}$ and $E_\nu=\{j\in\mathbb{N} : a_j=\nu\}$ ($\nu\geq 2$).
We suppose the following:

  
*
  
*There exists $(d_\nu)_{\nu\geq 2}$ (where $d_\nu\geq 0$) such that, for every $\nu$,
  $$\lim_{n\to\infty}\dfrac{1}{n}\textrm{card}(F_n\cap E_\nu)=d_\nu.$$
  
*There exists $c>0$ such that, for every $\nu$, 
  $$\sup_{n\geq 1}\dfrac{1}{n}\textrm{card}(F_N\cap E_\nu)\leq c d_\nu.$$
  
*$\sum_{\nu\geq 2}d_\nu (\log\nu)^2$ is finite.
  

This is the statement of the lemma:

Under the preceding hypotheses:
  
  
*
  
*$\sum_{\nu\geq 2}d_\nu=1$.
  
*$\sum_{j\in E_\nu}\dfrac{1}{j^2}\leq 2cd_\nu$.
  
*$\lim_{n\to\infty}\log(a_1\cdots a_n)=\sum_{\nu\geq 2}d_\nu \log\nu$.
  

I think I used dominated convergence correctly in 1 and 3. My problem is statement two. The proof just says "use summation by parts", but I don't get anything useful. Any ideas?
 A: Put $g_1=0$, $g_j := \operatorname{card}(F_{j-1}\cap E_\nu)$ for $j\ge 2$, and $f_j = \frac 1{j^2}$. Then
$$
\sum_{j\in E_\nu}\frac 1{j^2} = \sum_{j=1}^\infty f_j(g_{j+1}-g_j) = \lim_{n\to\infty}\sum_{j=1}^n f_j(g_{j+1}-g_j).
$$
This is the crucial part that you probably haven't seen. From here it is not difficult. Using summation by parts and condition 2, we get
\begin{align}
\sum_{j\in E_\nu}\frac 1{j^2}
&= \lim_{n\to\infty}\left[(f_ng_{n+1}-f_1g_1)-\sum_{j=2}^n g_j(f_j-f_{j-1})\right]\\
&= \lim_{n\to\infty}\left[\frac 1{n^2}\operatorname{card}(F_n\cap E_\nu)-\sum_{j=2}^n g_j(f_j-f_{j-1})\right]\\
&= \sum_{j=2}^\infty g_j(f_{j-1}-f_j)\\
&= \sum_{j=2}^\infty\left(\frac 1{(j-1)^2}-\frac 1{j^2}\right)\operatorname{card}(F_{j-1}\cap E_\nu)\\
&\le cd_\nu\cdot\sum_{j=2}^\infty\left(\frac 1{j-1}-\frac{j-1}{j^2}\right).
\end{align}
The $n$-th partial sum of the above series is
$$
\sum_{j=2}^n\left(\frac 1{j-1}-\frac{j-1}{j^2}\right) = \sum_{k=1}^{n-1}\frac 1{k^2} - \frac{n-1}{n^2}.
$$
This tends to $\frac{\pi^2}6\le 2$ as $n\to\infty$ and so
$$
\sum_{j\in E_\nu}\frac 1{j^2}\,\le\,\frac{\pi^2}6\cdot cd_\nu\,\le\,2cd_\nu.
$$

If you don't know that $\sum_{k=1}^\infty\frac 1{k^2} = \frac{\pi^2}6\le 2$, you can also estimate the series as follows:
$$
\sum_{k=1}^\infty\frac 1{k^2} = 1 + \sum_{k=2}^\infty\frac 1{k^2}\,\le\,1 + \int_1^\infty\frac 1{x^2}\,dx = 1-\frac 1x|_1^\infty = 2.
$$
