Sequences and Series – How Close Can Sum of Square Roots Be to an Integer?

approximation-theorydiophantine-approximationradicalssequences-and-seriessummation

How close can
$S(n) = \sum_{k=1}^n \sqrt{k}$
be to an integer?
Is there some $f(n)$ such that,
if $I(x)$ is the closest integer to $x$,
then $|S(n)-I(S(n))|\ge f(n)$
(such as $1/n^2$, $e^{-n}$, …).

This question was inspired by the recently proposed and answered question of
"prove that $\sum_{k=1}^n \sqrt{k}$
is never an integer/".
The question is here: Is $\sqrt1+\sqrt2+\dots+\sqrt n$ ever an integer?

The Euler-Maclaurin estimate for $S(n)$
might be useful.
According to an answer here,
(the link is "How to calculate the asymptotic expansion of $\sum \sqrt{k}$?")
$$S(n) = \frac{2}{3} n^{3/2} + \frac{1}{2} n^{1/2} + C + \frac{1}{24} n^{-1/2} + O(n^{-3/2})$$
where
$C=\zeta(-\frac 12)\approx-0.207886224977…$.

Best Answer

Suppose we are given a small $\epsilon\gt 0$. We show that we can choose $n$ such that $\sum_1^n\sqrt{k}$ is within $\epsilon$ of an integer. Relatively simple estimates are used.

For take $N\gt 1/\epsilon$. Then the numbers $$\sqrt{N^4+1},\quad \sqrt{N^4+2},\quad\text{and so on up to}\quad \sqrt{N^4+2N} $$ are greater than $N^2$ but within $\epsilon$ of $N^2$. Thus each of them is "nearly" an integer. To see this, note that $\left(N^2+\frac{1}{N}\right)^2 \gt N^4 +2N$.

Moreover, these numbers have fractional parts that add up to more than $1$. This is fairly straightforward, since the smallest fractional part is approximately $\frac{1}{2N}$.

So however far $\sum_1^{N^4} \sqrt{k}\,\,$ may be from an integer, one of the sums to $n=N^4+i$, where $1\le i\le 2N$, must come within $\epsilon$ of an integer.

Remark: It may be interesting to ask how much better one can do than $M\approx \frac{1}{\epsilon^4}$ to be sure that there is an $n\le M$ such that $\sum_1^n\sqrt{k}$ is within $\epsilon$ of an integer. Presumably much better! That is where more sophisticated ideas such as Euler-Maclaurin may be useful.

Related Question