How to compute $S_{2016}=\sum\limits_{k=1}^{2016}\left(\sum\limits_{n=k}^{2016}\frac1n\right)^2+\sum\limits_{k=1}^{2016}\frac1k$? I came across a question asking the value of the following sum:
\begin{align}
 \left(1+ \frac{1}{2}+\frac{1}{3}+\cdots +\frac 1{2015}+\frac{1}{2016}\right)^2 \\
+\left(\frac{1}{2}+\frac{1}{3}+\cdots +\frac 1{2015}+\frac{1}{2016}\right)^2 \\
+ \left(\frac{1}{3}+\cdots +\frac 1{2015}+\frac{1}{2016}\right)^2 \\[5 pt]
+\cdots \qquad\quad \vdots\qquad\qquad\\[5 pt]
+ \left(\frac{1}{2015}+\frac{1}{2016}\right)^2 \\
+ \left(\frac{1}{2016}\right)^2\\
+ \left(1+ \frac{1}{2}+\frac{1}{3}+\cdots +\frac 1{2015}+\frac{1}{2016}\right)\;
\end{align}
I can not find a good way to solve it. Any ideas?

Edit: That is, with no dots, $$S_{2016}=\sum_{k=1}^{2016}\left(\sum_{n=k}^{2016}\frac1n\right)^2+\sum_{k=1}^{2016}\frac1k$$
 A: If you expand all:
$$S=1+2\times \frac{1}{2^2}+3\times \frac{1}{3^2}+\cdots +2016 \cdot \frac{1}{2016^2}+$$
$$2\cdot 1\left(1\cdot \frac12+1\cdot \frac13+\cdots 1\cdot \frac{1}{2016}\right)+$$
$$2\cdot 2\left(\frac12 \cdot \frac13+\frac12 \cdot \frac14+\cdots +\frac12 \cdot \frac{1}{2016}\right)+$$
$$\vdots$$
$$2\cdot 2015\left(\frac{1}{2015}\cdot \frac{1}{2016}\right)+$$
$$1+\frac12+\cdots +\frac{1}{2016}=$$
$$2\left(1+\frac12+\cdots+\frac{1}{2016}\right)+$$
$$2\left(\frac12+\frac13+\cdots+\frac{1}{2016}\right)+$$
$$\vdots$$
$$2\left(\frac{1}{2016}\right)=$$
$$2\cdot (2016)=4032.$$
A: We show that for any positive integer $n$
$$
S_n:=\sum_{j=1}^n\left(\sum_{k=j}^n\frac{1}{k}\right)^2+\sum_{k=1}^n\frac{1}{k}=\sum_{j=1}^{n} (H_n-H_{j-1})^2 +H_n=2n.$$
where $H_n=\sum_{k=1}^n\frac{1}{k}$.
We have that
\begin{align*}
S_n&=nH_n^2-2H_n\sum_{j=1}^{n}H_{j-1}+\sum_{j=1}^{n}H_{j-1}^2+H_n\\
&=
nH_n^2-2H_n((n+1)H_{n}-n-H_n)\\
&\quad+((n+1)\,H_n^2-(2n+1)\,H_n+2n-H_n^2)+H_n\\
&=2n
\end{align*}
where we used
$$\sum_{j=1}^{n}H_j=(n+1)\,H_n-n,\quad \sum_{j=1}^n H_j^2=(n+1)\,H_n^2-(2n+1)\,H_n+2n$$
(see Sum of Squares of Harmonic Numbers).
A: (new solution - a bit shorter)
$$\require{cancel}\begin{align}
&\;\;\;\sum_{j=1}^n\left(\sum_{r=j}^n\frac 1r\right)^2+\sum_{j=1}^n\frac 1j\\
&=\sum_{j=1}^n\left(\sum_{r=j}^n\sum_{s=j}^n\frac 1{rs}\right)+\sum_{j=1}^n\frac 1j\\
&=\sum_{j=1}^n\left[2\sum_{r=j}^n\sum_{s=r}^n\frac 1{rs}-\sum_{r=j}^n\frac 1{r^2}\right]+\sum_{j=1}^n\frac 1j\\
&=2\sum_{j=1}^n\sum_{r=j}^n\sum_{s=r}^n\frac 1{rs}-\sum_{j=1}^n\sum_{r=j}^n\frac 1{r^2}+\sum_{j=1}^n\frac 1j\\
&=2\sum_{r=1}^n\sum_{j=1}^r\sum_{s=r}^n\frac 1{rs}-\sum_{r=1}^n\sum_{j=1}^r\frac 1{r^2}+\sum_{r=1}^n\frac 1r
&&\scriptsize(1\le j\le r\le n)\\
&=\color{lightgrey}{2\sum_{r=1}^n\sum_{s=r}^nr\cdot \frac 1{rs}-\sum_{r=1}^nr\cdot \frac 1{r^2}+\sum_{r=1}^n \frac 1r}\\
&=2\sum_{r=1}^n\sum_{s=r}^n\frac 1s\cancel{-\sum_{r=1}^n\frac 1r}+\cancel{\sum_{r=1}^n\frac 1r}\\
&=2\sum_{s=1}^n\sum_{r=1}^s\frac 1s
&&\scriptsize(1\le r\le s\le n)\\
&=2\sum_{s=1}^n1\\
&=\color{red}{2n}
\end{align}$$
Putting $n=2016$ gives the solution as $2\times 2016=\color{red}{4032}$.

(earlier solution below)  
$$\begin{align}
\left(1+\frac 12+\frac 13+\cdots+\frac 1{n-1}+\frac 1n\right)\;\, \\
+\left(1+\frac 12+\frac 13+\cdots+\frac 1{n-1}+\frac 1n\right)^2\\
+\left(\frac 12+\frac13+\cdots+\frac1{n-1}+\frac1n\right)^2\\
+\left(\frac13+\cdots+\frac1{n-1}+\frac1n\right)^2\\
+\cdots\qquad \qquad\vdots\quad \quad\\
+\left(\frac 1{n-1}+\frac 1n\right)^2\\
+\left(\frac 1n\right)^2\\
&=\sum_{j=1}^n \frac 1j+\sum_{j=1}^n\left(\sum_{r=j}^n\frac 1r\right)^2\\\
&=\sum_{j=1}^n\frac 1j+\sum_{j=1}^n\left(\sum_{r=j}^n \frac 1{r^2}+2\sum_{j\le r<s}^n\frac 1{rs}\right)\\
&=\sum_{j=1}^n\frac 1j+\sum_{j=1}^n\sum_{r=j}^n\frac 1{r^2}+2\sum_{j=1}^n\sum_{r=j}^n\sum_{s=r+1}^n\frac 1{rs}\\
&=\sum_{j=1}^n\frac 1j+\sum_{r=1}^n\sum_{j=1}^r\frac 1{r^2}+2\sum_{r=1}^{n-1}\sum_{j=1}^r\sum_{s=r+1}^n\frac 1{rs}
&&\scriptsize(1\le j\le r\le n)\atop{\scriptsize(1\le j\le r<s\le n)}\\
&=\sum_{j=1}^n\frac 1j+\sum_{r=1}^nr\cdot \frac 1{r^2}+2\sum_{r=1}^{n-1}\sum_{s=r+1}^nr\cdot \frac 1{rs}\\
&\color{lightgrey}{=\sum_{j=1}^n \frac 1j+\sum_{r=1}^n \frac 1r+2\sum_{r=1}^{n-1}\sum_{s=r+1}^n\frac 1s}\\
&=2\sum_{r=1}^n \frac 1r+2\sum_{r=1}^{n-1}\sum_{s=r+1}^n\frac 1s\\
&=2\sum_{r=0}^{n-1}\sum_{s=r+1}^n\frac 1s\\
&=2\sum_{s=1}^n\frac 1s\sum_{r=0}^{s-1}1\\
&=2\sum_{s=1}^n\frac 1s\cdot s\\
&=\color{red}{2n}\end{align}$$
Putting $n=2016$ gives the solution as $2\times 2016=\color{red}{4032}$.
