Calculate finite p-series Let $\sum_{k=1}^{n} \frac{1}{k^{1/2}}$ I have written a simple C++ program that computes the series for different values of n. What is the mathematical approach to finding this series.
 A: This is only an estimate, but it might be useful. Since $k^{-1/2}$ is a decreasing sequence, we can approximate the sum by integrals form above and below (see here)
$$
2\sqrt{n+1}-2=\int_1^{n+1}x^{-1/2}\mathrm dx\le\sum_{k=1}^n\frac1{k^{1/2}}\le\int_0^nx^{-1/2}\mathrm dx=2\sqrt{n}.
$$
Hence, we have that
$$
\frac{\sum_{k=1}^n\frac1{k^{1/2}}}{2\sqrt n}\to1
$$
as $n\to\infty$. So the sum is close to $2\sqrt n$ for large values of $n$.
A: You can also look at the problem using the definition of generalized harmonic numbers $$\sum_{k=1}^{n} \frac{1}{\sqrt k}=H_n^{\left(\frac{1}{2}\right)}$$ and, for large values of $n$, use the asymptotic development $$H_n^{\left(\frac{1}{2}\right)}=2 \sqrt{n}+\zeta \left(\frac{1}{2}\right)+\frac{1}{2\sqrt n}-\frac{1}{24 n\sqrt{n}}
  +O\left(\frac{1}{n^{7/2}}\right)$$ where $\zeta \left(\frac{1}{2}\right)\approx -1.46035$.
Just for illustrating purposes, using $n=10$, the correct value is $\approx 5.0209979$ while the above approximation leads to $\approx 5.0209971$.
Edit
After Ron Gordon's comment, I analyzed the error $\Delta_k$ as a function of the number of retained terms $k$ in the asymptotics (for $10\leq n \leq 1000$) and performed regressions $$\log|\Delta_k|=a_k+b_k\log(n) $$ The following results were obtained $$\log|\Delta_2|=-0.69842 - 0.49919 \log(n)\implies|\Delta_2|=0.497372 e^{-0.49919 x}$$ $$\log|\Delta_3|=-3.17828 - 1.49996  \log(n)\implies|\Delta_3|=0.041657 e^{-1.49996 x}$$ $$\log|\Delta_4|=-5.95265 - 3.49961  \log(n)\implies|\Delta_4|=0.002599 e^{-3.49961 x}$$ It is simple to check that the slope match almost exactly the power of the first neglected term (and that the constant term is almost identical to the logarithm of the corresponding coefficient).
