Compute $\left (1+\frac{1}{2}+\cdots+\frac{1}{n} \right )^2+\cdots+\left (\frac{1}{n-1}+\frac{1}{n} \right )^2+\left (\frac{1}{n} \right )^2$ Compute the value of the following expression
$$\left (1+\frac{1}{2}+\cdots+\frac{1}{n}  \right )^2+\left ( \frac{1}{2}+\cdots + \frac{1}{n}\right )^2+\cdots+\left (\frac{1}{n-1}+\frac{1}{n}  \right )^2+\left (\frac{1}{n}  \right )^2$$
The answer is $\boxed{2n-\left (1+\frac{1}{2}+\cdots+\frac{1}{n}  \right )}$.
I've been trying to do it but I've been failed. Any ideas ?
Wolfram's test

$$S_n - S_{n-1} = n\times \left(\frac{1}{n}\right)^2 + 2\frac{1}{n}\left(1 \times \frac11 +2 \times \frac12+\cdots + (n-1)\times \frac{1}{n-1} \right) = 2-\frac1n$$ and $S_0$ can be taken to be $0$, so just add up $(S_n - S_{n-1})+(S_{n-1} - S_{n-2})+\cdots + (S_{1} - S_{0})$.
