Formula for $\frac{1}{(n)^2}+\frac{1}{(n-1)^2}+\dots+\frac{1}{1^2}$. I have this question when I try to solve some problem.
We know $\frac{1}{(n)}+\frac{1}{(n-1)}+\dots+\frac{1}{1}\to(\log n)+\lambda$, as $n\to \infty$, where $\lambda$ is a constant.
What is the value of $\frac{1}{(n)^2}+\frac{1}{(n-1)^2}+\dots+\frac{1}{1^2}$?
More generally, what's
$
\sum_{m=1}^{n-1}\frac{1} {m^r} \frac{1} {(n-m)^{s}}$, as $n\to\infty$, where r+s is a positive natural number? (or a simpler question, when r=s.) Is there a formula for it? (Or a formula for its lower bound more accurate than $(n-1)(\frac{2}{n})^{2\max(r,s)}$ (obtained by using geometric mean being smaller than arithmetic mean?) Furthermore, what’s the case when r+s is a constant integer, or r-s is a constant integer?
 A: Well, this is the Basel Problem. We have $$ \lim_{n \to \infty} \Bigg[ \sum_{k = 1}^{n} \frac{1}{k^2} \Bigg] = \frac{\pi^2}{6} $$
And what you mentioned in your post,
$$ \lim_{n \to \infty} \Bigg[ \sum_{k = 1}^n \frac{1}{k} - \log(n) \Bigg] = \gamma $$
Where $\gamma$ is the Euler-Mascheroni Constant.
A: $\newcommand{\bbx}[1]{\,\bbox[15px,border:1px groove navy]{\displaystyle{#1}}\,}
 \newcommand{\braces}[1]{\left\lbrace\,{#1}\,\right\rbrace}
 \newcommand{\bracks}[1]{\left\lbrack\,{#1}\,\right\rbrack}
 \newcommand{\dd}{\mathrm{d}}
 \newcommand{\ds}[1]{\displaystyle{#1}}
 \newcommand{\expo}[1]{\,\mathrm{e}^{#1}\,}
 \newcommand{\ic}{\mathrm{i}}
 \newcommand{\mc}[1]{\mathcal{#1}}
 \newcommand{\mrm}[1]{\mathrm{#1}}
 \newcommand{\pars}[1]{\left(\,{#1}\,\right)}
 \newcommand{\partiald}[3][]{\frac{\partial^{#1} #2}{\partial #3^{#1}}}
 \newcommand{\root}[2][]{\,\sqrt[#1]{\,{#2}\,}\,}
 \newcommand{\totald}[3][]{\frac{\mathrm{d}^{#1} #2}{\mathrm{d} #3^{#1}}}
 \newcommand{\verts}[1]{\left\vert\,{#1}\,\right\vert}$
$\ds{\LARGE\left.a\right)}$
With the Abel-Plana Formula and
$\ds{\vartheta_{n - 1} \in \pars{0,1}}$:
\begin{align}
\sum_{k = 1}^{n}{1 \over k^{2}} & =
\sum_{k = 0}^{n - 1}{1 \over \pars{k + 1}^{2}}
\\[5mm] & =
\int_{0}^{n - 1}{\dd x \over \pars{x + 1}^{2}} +
\bracks{{1 \over 2}\,{1 \over \pars{k + 1}^{2}}}_{\ k\ =\ 0} +
\bracks{{1 \over 2}\,{1 \over \pars{k + 1}^{2}}}_{\ k\ =\ n - 1}
\\[2mm] &
+\ \underbrace{4\int_{0}^{\infty}{x \over
\pars{x^{2} + 1}^{2}\pars{\expo{2\pi x} - 1}}\,\dd x}
_{\ds{{\pi^{2} \over 6} - {3 \over 2}}}\ +\
\sum_{s = 1}^{m}{B_{2s} \over \pars{2s}!}
\bracks{-\,{\pars{2s}! \over n ^{2s + 1}}}
\\[2mm] &
+ 2\pars{-1}^{m}\pars{2m + 1}\int_{0}^{\infty}
\Im\pars{\bracks{n + \ic\vartheta_{n - 1}x}^{-2m - 2}}\,
{x^{2m} \over \expo{2\pi x} - 1}\,\dd x
\\[5mm] & =
\pars{1 - {1 \over n}} + {1 \over 2} + {1 \over 2n^{2}} +
\pars{{\pi^{2} \over 6} - {3 \over 2}} -
\sum_{s = 1}^{m}{B_{2s} \over n^{2s + 1}}
\\[2mm] & 
+ 2\pars{-1}^{m}\pars{2m + 1}\int_{0}^{\infty}
\Im\pars{\bracks{n + \ic\vartheta_{n - 1}x}^{-2m - 2}}\,
{x^{2m} \over \expo{2\pi x} - 1}\,\dd x
\\[5mm] & =
\bbox[10px,#ffd]{{\pi^{2} \over 6} - {1 \over n} + {1 \over 2n^{2}} +
\sum_{s = 1}^{m}{B_{2s} \over n^{2s + 1}}}
\\[2mm] &
\bbox[10px,#ffd]{+\ 2\pars{-1}^{m}\pars{2m + 1}}
\\[1mm] & \bbox[10px,#ffd]{\left. \phantom{=}\times\int_{0}^{\infty}
\Im\pars{\bracks{n + \ic\vartheta_{n - 1}x}^{-2m - 2}}
{x^{2m} \over \expo{2\pi x} - 1}
\,\dd x\,\right\vert_{\, \vartheta_{n - 1}\ \in\ \pars{0,1}}}
\end{align}

$\ds{\LARGE\left.b\right)}$
By using a
Zeta function identity:
\begin{align}
\sum_{k = 1}^{n}{1 \over k^{\color{red}{2}}} & =
\zeta\pars{2} - \,{n^{1 - \color{red}{2}} \over \color{red}{2} - 1} +
\color{red}{2}\int_{n}^{\infty}
{x - \left\lfloor\,{x}\,\right\rfloor \over x^{\color{red}{2} + 1}}
\,\dd x
\\[5mm] & =
{\pi^{2} \over 6} - {1 \over n} +
2\sum_{k = n}^{\infty}\int_{k}^{k +1}{x - k \over x^{3}}\,\dd x
\\[5mm] & =
{\pi^{2} \over 6} - {1 \over n} +\
\underbrace{\sum_{k = n}^{\infty}{1 \over k\pars{k + 1}^{2}}}
_{\ds{1 + n - n^{2}\,\Psi\, '\pars{n} \over n^{2}}}\quad
\pars{~\Psi\, ':\ Trigamma\ Function~}
\\[5mm] & =
\bbox[10px,#ffd]{{\pi^{2} \over 6} - {1 \over n} + {1 \over 2n^{2}} -
{1 \over 6n^{3}} + {1 \over 30n^{5}} + \mrm{O}\pars{1 \over n^{6}}}
\end{align}
A: $$S'=\sum_{k=2}^{n} \frac{1}{k^2} < \sum_{k=2}^n \frac{1}{k(k-1)}= \sum_{k=2}^{n}\left(\frac{1}{k-1}-\frac{1}{k}\right)$$
By telescopic summation, we get $$S'<1-\frac{1}{n}.$$
Hence, $$\sum_{k=1}^{n} \frac{1}{k^2}< 2-\frac{1}{n}$$
The sum of yhe infinite version of this series is well known as $\frac{\pi^2}{6}$.
A: To answer your last question, we have that
$$(n-1)^{1-\max(r,s)} \leq \sum_{m=1}^{n-1}\frac{1}{m^r}\frac{1}{(n-m)^s} \leq (n-1)^{1-\min(r,s)}$$
WLOG, we can assume $s \leq r$ (since the sum is symmetric when summing backwards). So we see that the sum only exists when $s\geq 1$
A: There is an asymptotic expansion in terms of the Bernoulli numbers:
$$
\sum\limits_{k = 1}^n {\frac{1}{{k^2 }}}  \sim \frac{{\pi ^2 }}{6} - \frac{1}{n} + \frac{1}{{2n^2 }} - \sum\limits_{k = 1}^\infty  {\frac{{B_{2k} }}{{n^{2k + 1} }}} 
$$
as $n\to +\infty$. This shows how the limit $\frac{\pi^2}{6}$ is approached.
