What is $\lim_{x\to \infty} 2\sqrt{x}- \sum_{n=1}^x {1\over \sqrt{n}}$? I ask this because I noticed the partial sum $\sum_{n=1}^x {1\over \sqrt{n}}$ is very close to $2\sqrt{x}$, so close in fact that it appears their difference approaches a constant value, like $H_x$ and $\ln x$. However, when I put this limit as is into Wolfram, it said the limit diverged. 
But, I found a way to transform the limit into an infinite sum, by using the transformation $f(x) = f(0) + \sum_{n=1}^x f(n) - f(n-1)$, an application of telescoping series to partial sums.
Thus,
\begin{align*}\lim_{x\to \infty} \left(2\sqrt{x}- \sum_{n=1}^x {1\over \sqrt{n}} \right) &= 
\lim_{x\to \infty} \left( 2\sqrt{0} + \sum_{n=1}^x \left( 2\sqrt{n} - 2\sqrt{n-1} \right) - \sum_{n=1}^x {1\over \sqrt{n}} \right) \\
&= \sum_{n=1}^{\infty} \left(2\sqrt{n} - 2\sqrt{n-1} -{1\over \sqrt{n}} \right)
\end{align*}
This sum converges according to Wolfram by comparison test, and according to me by the integral test, but what does it converge to? It converges incredibly slowly; my best guess is $\approx 1.458$
 A: May be, we could use generalized harmonic numbers since $$\sum_{n=1}^x {1\over \sqrt{n}}=H_x^{\left(\frac{1}{2}\right)}$$ and use the asymptotics for large values of $n$ $$H_x^{\left(\frac{1}{2}\right)}=2 \sqrt{x}+\zeta
   \left(\frac{1}{2}\right)+\frac 1 {2\sqrt x}+O\left(\frac{1}{x^{3/2}}\right)$$
A: Too lazy to whip up anything fancy, but
program z2
   use ISO_FORTRAN_ENV,only:wp=>REAL128
   real(wp) zeta,x
   integer k, M
   M = 100000000
   zeta = sum([(1/sqrt(real(k,wp)),k=1,M)])- &
      2*sqrt(M+0.5_wp)-1/(48*sqrt(M+0.5_wp)**3)
   write(*,*) zeta
end program z2

Spits out $-1.46035450880958681288949915247298$, which has $29$ digits of $\zeta\left(\frac12\right)$ correct. What you are doing amounts to analytical continuation of the Riemann zeta function.  
You want proof? OK, all I can remember about the midpoint rule is that
$$\int_0^1f(x)dx=f\left(\frac12\right)+Cf^{\prime\prime}(\xi)$$
For some $\xi\in(0,1)$. I can never remember the value of $C$, but if $f(x)=\frac12\left(x-\frac12\right)^2$, then
$$\int_0^1f(x)dx=\frac12\frac13\frac18(2)=\frac1{24}=f\left(\frac12\right)+Cf^{\prime\prime}(\xi)=0+C\cdot1=C$$
So then we can say that
$$\begin{align}\sum_{k=1}^Nf(k)&=\sum_{k=1}^Mf(k)+\sum_{k=M+1}^Nf(k)\\
&=\sum_{k=1}^Mf(k)+\int_{M+\frac12}^{N+\frac12}f(x)dx-\frac1{24}\sum_{k=M+1}^Nf^{\prime\prime}(\xi_k)\\
&=\sum_{k=1}^Mf(k)+2\sqrt{N+\frac12}-2\sqrt{M+\frac12}-\frac1{24}\sum_{k=M+1}^Nf^{\prime\prime}(\xi_k)\end{align}$$
There is a mean value theorem that allows you to bound
$$-\frac1{24}\sum_{k=M+1}^Nf^{\prime\prime}(\xi_k)$$
by
$$-\frac1{24}\int_{M+\frac12}^{N+\frac12}f^{\prime\prime}(x)dx=-\frac1{24}\left[f^{\prime}\left(N+\frac12\right)-f^{\prime}\left(M+\frac12\right)\right]$$
To within a little variation of the endpoints. For the Riemann zeta function, $\zeta(s)$ with $\Re s>1$, this accelerates convergence but more importantly taking the limit as $N\rightarrow\infty$ just mean throwing out all the upper bound terms. The term with $M$, however makes the whole thing converge for $\Re s>0$ and so provides analytical continuation of the Riemann zeta function. I retained the
$$\frac1{24}f^{\prime}\left(M+\frac12\right)=-\frac1{48}\left(M+\frac12\right)^{-3/2}$$
term in my program because it's the right next-order term and helps convergence along. Thus I was approximating
$$\zeta\left(\frac12\right)\approx\sum_{k=1}^M\frac1{\sqrt k}-2\sqrt{M+\frac12}-\frac1{48}\left(M+\frac12\right)^{-3/2}$$
So this not only provides analytical continuation but accelerates convergence. Whoops, I see that I had the wrong sign on that last term, here let me fix it... now it's good to $29$ digits, that's more like it!
A: use that $$\sum_{k=1}^n k^{-1/2} = \int_{1-\epsilon}^{n+\epsilon} \left(\sum_{k=1}^n \delta(x-k)\right) x^{-1/2} dx  = n^{1/2} +  \frac{1}{2}\int_1^n \lfloor x \rfloor x^{-3/2} dx$$ (some sort of integration by parts, see Abel's summation formula ) 
while $$ n^{1/2} = 1+\frac{1}{2}\int_1^n x^{-1/2} dx$$
hence
$$A_n =   2 n^{1/2}-\sum_{k=1}^n k^{-1/2} = 1 + \frac{1}{2}\int_1^n (x-\lfloor x \rfloor) x^{-3/2} dx = \frac{1}{2}\int_0^n (x-\lfloor x \rfloor) \,x^{-3/2} dx$$
and for $Re(s) \in \ ]0,1[ $ (using the same trick as above) $$\zeta(s) = -s\int_0^\infty (x-\lfloor x \rfloor ) \,x^{-s-1} dx$$
we get 
$$\lim_{n \to \infty} A_n = \frac{1}{2}\int_0^\infty (x-\lfloor x \rfloor) \,x^{-3/2} dx = - \zeta(1/2) \approx 1.460355$$
