<s>[INST] Sum of Square roots formula. I would like to know if there is formula to calculate sum of series of square roots $\sqrt{1} + \sqrt{2}+\dotsb+ \sqrt{n}$ like the one for the series $1 + 2 +\ldots+ n = \frac{n(n+1)}{2}$.
Thanks in advance.
 [/INST] For integer square roots, one should note that there are runs of equal values and increasing lengths
$$1,1,1,2,2,2,2,2,3,3,3,3,3,3,3,4,4,4,4,4,4,4,4,4\dots$$
For every integer $i$ there are $(i+1)^2-i^2=2i+1$ replicas, and by the Faulhaber formulas
$$\sum_{i=1}^m i(2i+1)=2\frac{2m^3+3m^2+m}6+\frac{m^2+m}2=\frac{4m^3+9m^2+5m}{6}.$$
When $n$ is a perfect square minus $1$, all runs are complete and the above formula applies, with $m=\sqrt{n+1}-1$.
Otherwise, the last run is incomplete and has $n-\left(\lfloor\sqrt n\rfloor\right)^2+1$ elements.
Hence, with $m=\lfloor\sqrt n\rfloor$,
$$S_n=\frac{4(m-1)^3+9(m-1)^2+5(m-1)}{6}+m\left(n-m^2+1\right)\\
=m\left(n-\frac{2m^2+3m-5}6\right).$$
</s>