Summation of square root fractional part Is there a way to calculate the following sum for large $c>K$, closed-form or approximation?
$$\sum_{n=1}^{c}\left\{\sqrt{K+n^2}\right\}$$Where K and n are positive integers and $\{\}$ indicates the fractional part.
A similar question: Fractional part summation
 A: The given sum can be written as
$$
\Sigma = \Sigma_1 - \Sigma_2
$$
where
$$
\Sigma_1 = \sum_{n=1}^{c} \sqrt{n^2 + K}
$$
and
$$
\Sigma_2 = \sum_{n=1}^{c} \lfloor\sqrt{n^2 + K}\rfloor.
$$
Now using $H_n = \log n + \gamma + \mathcal{O}(1/n)$ where $H_n$ is the $n$-th harmonic number,
\begin{align*}
\sum_{n=1}^{c} \sqrt{n^2 + K} - n &= \sum_{n=1}^c \frac{K}{\sqrt{n^2 + K} + n} \\
                                  &\le \frac{K}{2} \sum_{n=1}^{c} \frac{1}{n} = \frac{K}{2}(\log c + \gamma + \mathcal{O}(1/c)).
\end{align*}
Hence
$$
\Sigma_{1} = \sum_{n=1}^{c} \sqrt{n^2 + K} = \frac{1}{2}c(c+1) + \frac{K}{2}(\log c + \gamma) + \mathcal{O}(1/c)
$$
Let $A = \lfloor\sqrt{K+1} - 1\rfloor$. Then,
\begin{align*}
  \Sigma_{2} = \sum_{n=1}^{c} \lfloor\sqrt{n^2 + K}\rfloor &= \sum_{j=1}^{A}\sum_{\frac{K-(j+1)^2}{2(j+1)} < n \le \frac{K-j^2}{2j}}(n+j) + \sum_{\frac{K-1}{2} < n \le c}n \\
&= \sum_{n=1}^c n +  \sum_{j=1}^{A}\sum_{\frac{K-(j+1)^2}{2(j+1)} < n \le \frac{K-j^2}{2j}}j\\
&= \frac{1}{2}c(c+1) + \sum_{j=1}^A j\left(\frac{3}{2} + \frac{K}{2j(j+1)}+ \mathcal{O}(1)\right)\\
&= \frac{1}{2}c(c+1) + \frac{3}{4}A(A+1) + \frac{K}{2}(H_A - 1) + \mathcal{O}\left(\sum_{j=1}^A j\right)\\
&= \frac{1}{2}c(c+1) + \frac{3}{4}A(A+1) + \frac{K}{2}(H_A - 1) + \mathcal{O}(1)
\end{align*}
since $\mathcal{O}\left(\sum_{j=1}^A j\right) = \mathcal{O}(K) = \mathcal{O}(1)$.
Thus,
\begin{align*}
\Sigma &= \frac{K}{2}(\log c + \gamma) - \frac{3}{4}A(A+1) - \frac{K}{2}(H_A - 1) + \mathcal{O}(1).\\
\end{align*}
