From the series $\sum_{n=1}^{+\infty}\left(H_n-\ln n-\gamma-\frac1{2n}\right)$ to $\zeta(\frac12+it)$.

Proof of (*)

Adding the four finite sums,

$$\sum_{k=1}^{n}H_{k}=(n+1)H_{n}-n,$$

$$\sum_{k=1}^{n}\ln{k}=\ln{n!},$$

$$\sum_{k=1}^{n}\gamma=\gamma\,n,$$

$$\sum_{k=1}^{n}\frac{1}{2k}=\frac12H_{n},$$

gives us a representation of the $n$-th partial sum for the infinite series. Writing the infinite series as the limit of partial sums, we get:

$$\begin{align} S &=\sum_{k=1}^{\infty}\left(H_{k}-\ln{n}-\gamma-\frac{1}{2k}\right)\\ &=\lim_{n\to\infty}\sum_{k=1}^{n}\left(H_{k}-\ln{n}-\gamma-\frac{1}{2k}\right)\\ &=\lim_{n\to\infty}\left((n+1)H_{n}-n-\ln{n!}-\gamma\,n-\frac12H_{n}\right)\\ &=\lim_{n\to\infty}\left(\left(n+\frac12\right)H_{n}-(1+\gamma)n-\ln{n!}\right). \end{align}$$

Use Stirling's approximation for the factorial to obtain an asymptotic formula for the log-factorial term in the series:

$$n!\sim\sqrt{2\pi n}\left(\frac{n}{e}\right)^n\\ \implies \ln{n!}\sim\ln{\left(\sqrt{2\pi n}\left(\frac{n}{e}\right)^n\right)}=\left(n+\frac12\right)\ln{n}-n+\frac12\ln{(2\pi)}.$$

Then,

$$\begin{align} S &=\lim_{n\to\infty}\left(\left(n+\frac12\right)H_{n}-(1+\gamma)n-\ln{n!}\right)\\ &=\lim_{n\to\infty}\left(\left(n+\frac12\right)H_{n}-(1+\gamma)n-\left(n+\frac12\right)\ln{n}+n-\frac12\ln{(2\pi)}\right)\\ &=\lim_{n\to\infty}\left(\left(n+\frac12\right)H_{n}-\gamma\,n-\left(n+\frac12\right)\ln{n}\right)-\frac12\ln{(2\pi)}\\ &=\lim_{n\to\infty}\left(n\left(H_{n}-\gamma-\ln{n}\right)+\frac12\left(H_{n}-\ln{n}\right)\right)-\frac12\ln{(2\pi)}\\ &=\lim_{n\to\infty}n\left(H_{n}-\gamma-\ln{n}\right)+\frac12\lim_{n\to\infty}\left(H_{n}-\ln{n}\right)-\frac12\ln{(2\pi)}\\ &=\lim_{n\to\infty}n\left(H_{n}-\gamma-\ln{n}\right)+\frac12\gamma-\frac12\ln{(2\pi)}\\ &=\frac12+\frac12\gamma-\frac12\ln{(2\pi)}.~~~\blacksquare \end{align}$$


Appendix:

Using the asymptotic series for the digamma function given by Eq.16 on this Wolfram Mathworld page,

$$\begin{align} \lim_{n\to\infty}n\left(H_{n}-\gamma-\ln{n}\right) &=\lim_{n\to\infty}n\left(\Psi{(n+1)}-\ln{n}\right)\\ &=\lim_{n\to\infty}n\left(\frac{1}{2n}-\sum_{\ell=1}^{\infty}\frac{B_{2\ell}}{2\ell n^{2\ell}}\right)\\ &=\frac12-\lim_{n\to\infty}\sum_{\ell=1}^{\infty}\frac{B_{2\ell}}{2\ell n^{2\ell-1}}\\ &=\frac12. \end{align}$$


Observe that $$ H_{n}-\ln n-\gamma -\frac{1}{2n} = \psi (n) - \ln n + \frac{1}{2n} $$ where $\psi := \Gamma'/\Gamma$ is the digamma function, using $\displaystyle \psi (n)= H_{n-1}-\gamma = H_n-\gamma- \frac{1}{n}$, $n\geq 1$.

Our initial series thus rewrites $$ \sum_{n=1}^{\infty} \left( \psi(n )- \log n + \frac{1}{2n}\right) = \frac{\gamma}{2} - \frac{1}{2}\ln(2\pi)+ \frac{1}{2}, $$ (proved by David H).

Then consider the one parameter series $$ \sum_{n=1}^{\infty}\left(\psi(n \alpha)- \log (n \alpha) + \frac{1}{2n \alpha}\right), \quad \alpha >0. $$ We have the following result.

Theorem 1. Let $\alpha$ and $\beta$ be positive real numbers such that $ \alpha\beta=1$.

Then \begin{align} &\sqrt{\alpha}\left\{\frac{\gamma-\log(2\pi\alpha)}{2\alpha}+ \sum_{n=1}^{\infty}\left(\psi(n \alpha)- \log (n \alpha) + \frac{1}{2n \alpha}\right)\right\}\\ = & \sqrt{\beta}\left\{\frac{\gamma-\log(2\pi\beta)}{2\beta}+\sum_{n=1}^{\infty}\left(\psi(n \beta)- \log (n \beta) + \frac{1}{2n \beta}\right)\right\} \\ = &-\frac{1}{\pi^{3/2}}\int_0^{\infty}\left|\xi\left(\frac{1}{2}+\frac{it}{2}\right)\Gamma\left(\frac{-1+it}{4}\right)\right|^2 \frac{\cos\left(\frac{t}{2}\log\alpha\right)}{1+t^2}dt, \end{align}

where $$ \xi(s):=\frac{s(s-1)}{2} \displaystyle \pi^{-s/2}\:\Gamma(\frac{s}{2})\zeta(s)$$ and where $\zeta$ is the Riemann zeta function.

Now express $\displaystyle \left|\xi\left(\frac{1}{2}+\frac{it}{2}\right)\right|^2 $ in terms of $\left|\zeta \left(\frac{1}{2}+ it\right)\right|^2$ and you obtain the evocated link.

Theorem 1 is due to Ramanujan and one may find a recent proof here.

Here is a related result I have found.

Theorem 2. Let $\Re \alpha >0$.

Then $$ \sum_{n=1}^{\infty} \! \left(\! \psi(\alpha n )- \log (\alpha n ) + \frac{1}{2 \alpha n }\! \right)\! =\! \displaystyle \frac{1+\gamma-\log(2\pi)}{2} \\ -\int_{0}^{1}\left(\frac{1}{\alpha (1-x^{1/\alpha})}-\frac{1}{1-x}+\frac{1}{2}-\frac{1}{2\alpha}\!\right)\!\frac{\mathrm{d}x}{1-x}.$$

Thanks.


Since $$ 1+\sum_{k=2}^n\left(\frac1k-\log\left(\frac{k}{k-1}\right)\right)=H_n-\log(n) $$ we have $$ \begin{align} H_n-\log(n)-\gamma &=\sum_{k=n+1}^\infty\left(\log\left(\frac{k}{k-1}\right)-\frac1k\right)\\ &=\sum_{k=n}^\infty\left(\log\left(\frac{k+1}k\right)-\frac1{k+1}\right) \end{align} $$ Furthermore, $$ \frac1{2n}=\sum_{k=n}^\infty\frac12\left(\frac1k-\frac1{k+1}\right) $$ Therefore, $$ H_n-\log(n)-\gamma-\frac1{2n}=\sum_{k=n}^\infty\left(\log\left(\frac{k+1}k\right)-\frac12\left(\frac1{k+1}+\frac1k\right)\right) $$ Summing, we have $$ \begin{align} &\sum_{n=1}^\infty\left(H_n-\log(n)-\gamma-\frac1{2n}\right)\\ &=\sum_{n=1}^\infty\sum_{k=n}^\infty\left(\log\left(\frac{k+1}k\right)-\frac12\left(\frac1{k+1}+\frac1k\right)\right)\\ &=\sum_{k=1}^\infty\sum_{n=1}^k\left(\log\left(\frac{k+1}k\right)-\frac12\left(\frac1{k+1}+\frac1k\right)\right)\\ &=\sum_{k=1}^\infty k\left(\log\left(\frac{k+1}k\right)-\frac12\left(\frac1{k+1}+\frac1k\right)\right) \end{align} $$ and $$ \begin{align} &\sum_{k=1}^nk\left(\log\left(\frac{k+1}k\right)-\frac12\left(\frac1{k+1}+\frac1k\right)\right)\\ &=\sum_{k=2}^{n+1}(k-1)\log(k)-\sum_{k=1}^nk\log(k)-\sum_{k=1}^n\left(1-\frac1{2(k+1)}\right)\\ &=\color{#C00000}{n\log(n+1)}\color{#00A000}{-\log(n!)-n}\color{#0000F0}{+\frac12(H_{n+1}-1)}\\ &=\color{#C00000}{n\log(n)+1+O\!\left(\frac1n\right)}\color{#00A000}{-\left(n+\frac12\right)\log(n)-\frac12\log(2\pi)+O\!\left(\frac1n\right)}\\ &\color{#0000F0}{+\frac12\log(n)+\frac12\gamma-\frac12+O\!\left(\frac1n\right)}\\ &=\frac12\left(1+\gamma-\log(2\pi)\right)+O\!\left(\frac1n\right) \end{align} $$ Thus, $$ \bbox[5px,border:2px solid #C0A000]{\sum_{n=1}^\infty\left(H_n-\log(n)-\gamma-\frac1{2n}\right)=\frac{1+\gamma-\log(2\pi)}2} $$