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} $$
Some generalizations: $$ \begin{aligned} &\boxed{\begin{aligned} &\sum_{n = 1}^{\infty} n \left ( H_n-\gamma-\ln n-\frac{1}{2n}+\frac{1}{12n^2} \right ) = \frac{5}{24}+\frac{\gamma}{12}-\ln A\\ &\sum_{n = 1}^{\infty} n^2 \left ( H_n-\gamma-\ln n-\frac{1}{2n}+\frac{1}{12n^2} \right ) = \frac{1}{24}-\frac{\zeta(3)}{4\pi^2}\\ &\sum_{n=1}^{\infty}(-1)^{n-1}n^4\left ( H_n-\gamma -\ln n-\frac{1}{2n} +\frac{1}{12n^2}-\frac{1}{120n^4} \right ) =\frac{59}{240}-\frac{93\zeta(5)}{4\pi^4} \\ &\sum_{n=1}^{\infty} (-1)^{n-1}n^4 \left(H_n^{(2)}-\frac{\pi^2}{6}+\frac{1}{n}-\frac{1}{2n^2}+\frac{1}{6n^3} \right) =\frac{\ln2}{2}-\frac{1}{3} \end{aligned}}\\ \\ &\boxed{\begin{aligned} &\sum_{n=1}^{\infty} (-1)^{n-1}\left ( H^{(3)}_n-\zeta(3) \right ) = -\frac{1}{8}\zeta(3)\\ &\sum_{n=1}^{\infty} (-1)^{n-1}n\left ( H^{(3)}_n-\zeta(3) \right ) = \frac{\pi^2}{24} -\frac{7}{16}\zeta(3)\\ &\sum_{n=1}^{\infty} (-1)^{n-1}n^2\left ( H^{(3)}_n-\zeta(3) +\frac{1}{2n^2} \right ) = \frac{\ln2}{2} -\frac{\pi^2}{24}+\frac{1}{4}\\ &\sum_{n=1}^{\infty} (-1)^{n-1}n^3\left ( H^{(3)}_n-\zeta(3) +\frac{1}{2n^2} -\frac{1}{2n^3} \right) =\frac{7}{32}\zeta(3)-\frac{3}{4}\ln2 +\frac{1}{8}\\ &\sum_{n=1}^{\infty} (-1)^{n-1}n^4\left ( H^{(3)}_n-\zeta(3) +\frac{1}{2n^2} -\frac{1}{2n^3}+\frac{1}{4n^4} \right) =\frac{\pi^2}{24}-\frac{9}{24}\\ &\sum_{n=1}^{\infty} (-1)^{n-1}n^5\left ( H^{(3)}_n-\zeta(3) +\frac{1}{2n^2} -\frac{1}{2n^3}+\frac{1}{4n^4} \right) =-\frac{7}{16}\zeta(3)+\frac{5}{4}\ln2-\frac{5}{16} \end{aligned} }\\ \\ &\boxed{\begin{aligned} &\sum_{n=1}^{\infty}(-1)^{n-1}\left ( H^{(4)}_n -\frac{\pi^4}{90} \right ) = -\frac{\pi^4}{1440}\\ &\sum_{n=1}^{\infty}(-1)^{n-1}n\left ( H^{(4)}_n -\frac{\pi^4}{90} \right ) =\frac{3}{8}\zeta(3) -\frac{\pi^4}{192}\\ &\sum_{n=1}^{\infty}(-1)^{n-1}n^2\left ( H^{(4)}_n -\frac{\pi^4}{90} \right ) =-\frac{9}{24}\zeta(3)+\frac{\pi^2}{24}\\ &\sum_{n = 1}^{\infty}(-1)^{n-1}n^3\left ( H^{(4)}_n -\frac{\pi^4}{90}+\frac{1}{3n^3} \right ) = -\frac{\pi^2}{16}+\frac{\pi^4}{384}+\frac{\ln2}{2} +\frac{1}{6} \end{aligned}} \end{aligned} $$
Start from the following integral
$$\int_{0}^{\infty} x^{s-1}
\left ( \psi^{(0)}(1+x)-\ln x\right ) \text{d}x
=-\frac{\pi\zeta(1-s)}{\sin\pi s}$$
Where $0<s<1$.
And
$$
\frac{1}{2\pi i} \int_{c-i\infty}^{c+i\infty}
\frac{-\pi\zeta(1-s)}{\sin(\pi s)}z^{-s}\text{d}s
=\psi^{(0)}(1+z)-\ln z
$$
Where $0<c<1$.
Thus we have
$$\begin{aligned}
&\int_{-\infty}^{\infty} \frac{\zeta\left ( \frac{1}{2}+it \right ) }{\cosh(\pi t)}\text{d}t = 2\gamma-2\\
&\int_{-\infty}^{\infty} \frac{\zeta\left ( -\frac{1}{2}-it \right ) \zeta\left ( \frac{3}{2}+it \right )}{\cosh(\pi t)}\text{d}t
=\gamma-\ln(2\pi)+1
\end{aligned}$$