Intereting Posts

For $k<n/2$ construct a bijection $f$ from $k$-subsets of $$ to $(n-k)$-subsets s.t. $x\subseteq f(x)$
Show that $A$ is symmetric, with $A \in M_n(\mathbb R)$
Infinite algebraic extensions of $\mathbb{Q}$
Polynomial $p(a) = 1$, why does it have at most 2 integer roots?
One to one function proof
do all uncountable sets have same cardinality as real numbers?
How do I show that the sum $(a+\frac12)^n+(b+\frac12)^n$ is an integer for only finitely many $n$?
Show $2(x+y+z)-xyz\leq 10$ if $x^2+y^2+z^2=9$
Rectangle with lattice points
Is this continuous analogue to the AM–GM inequality true?
Prove that $\vert\sin(x)\sin(2x)\sin(2^2x)\cdots\sin(2^nx)\vert < \left(\frac{\sqrt{3}}{2}\right)^n$
Series expansion of incomplete gamma function ratio
Why do we do mathematical induction only for positive whole numbers?
How can one show that ${\rm Hom}\Bigl(\prod\limits_{i\geqslant 1} \Bbb Z,\Bbb Z\Bigr)$ has cardinality less than $2^{\mathfrak c}$?
Why is the sum of the rolls of two dices a Binomial Distribution? What is defined as a success in this experiment?

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?

- Simple proof by induction: $1^3 + 2^3 +3^3 +…+ n^3 = ^2 $
- Grandi's Series; tends to $1/2$, but why is this considered a valid sum?
- Evaluate $\sum\limits_{k=1}^{n} \frac{k}{2^k}$
- Prove the congruence $ \sum_{r=1}^{p-1}{(r|p) * r } \equiv 0 \pmod p.$
- Induction proof of $\sum_{k=1}^{n} \binom n k = 2^n -1 $
- Find a simple formula for $\binom{n}{0}\binom{n}{1}+\binom{n}{1}\binom{n}{2}+…+\binom{n}{n-1}\binom{n}{n}$

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…$.

- Sum of odd numbers always gives a perfect square.
- A double sum with combinatorial factors
- evaluating sum of limits
- Combination of quadratic and cubic series
- Xmas Combinatorics 2014
- How can I solve $\sum\limits_{i = 1}^k i \binom{k}{i-1}$
- Non-induction proof of $2\sqrt{n+1}-2<\sum_{k=1}^{n}{\frac{1}{\sqrt{k}}}<2\sqrt{n}-1$
- Where do summation formulas come from?

Thanks Marty for a fascinating question. We can get the entire

asymptotic expansion quite easily using Mellin transforms.

Start with the telescoping sum

$$ S(x) = \sum_{k\ge 1} \left(\sqrt{k}-\sqrt{x+k}\right)$$

which has the property that $$ S(n) = \sum_{q=1}^n \sqrt{q}$$

so that $S(n)$ is the value we are looking for.

Now re-write the inner term so that we can see the harmonics:

$$ \sqrt{k}-\sqrt{x+k} = \sqrt{k}\left(1-\sqrt{x/k+1}\right).$$

Now recall that

$$\mathfrak{M}\left(\sum_{k\ge 1} \lambda_k g(\mu_k x); s\right)=

\left(\sum_{k\ge 1} \frac{\lambda_k}{\mu_k^s} \right)g^*(s)$$

where $g^*(s)$ is the Mellin transform of $g(x).$

In the present case we have

$$\lambda_k = \sqrt{k}, \quad \mu_k = \frac{1}{k}

\quad \text{and} \quad g(x) = 1-\sqrt{1+x}.$$

It follows that $$ \sum_{k\ge 1} \frac{\lambda_k}{\mu_k^s} =

\sum_{k\ge 1} \sqrt{k} \times k^s =\zeta(-1/2-s).$$

Furthermore we have

$$\mathfrak{M}(g(x); s) = \frac{1}{2\sqrt{\pi}} \Gamma(-1/2-s)\Gamma(s).$$

Now this transform has fundamental strip $\langle -1, -1/2 \rangle$ while the zeta function term has $-s-1/2 > 1$ or $s < -3/2.$ These two are disjoint. Therefore we need to modify $g(x)$ by canceling the next term in the power series of $-\sqrt{1+x},$

which gives $$g(x) = 1 + \frac{1}{2} x – \sqrt{x+1},$$ with fundamental strip

$\langle -2, -1 \rangle,$ and the transform of $g(x)$ being the same. This strip is perfect as the half-plane of convergence of the zeta function term starts right in the middle of it, extending to the left.

It is important to note that we have now added $$\sum_{k\ge 1} \frac{1}{2}\sqrt{k} \frac{x}{k} = \frac{1}{2} x \sum_{k\ge 1} \frac{1}{\sqrt{k}} = \frac{1}{2} x \zeta(1/2)$$ to our sum, which we will have to subtract out at the end.

The conclusion is that the Mellin transform $T(s)$ of $S(x)$ is given by

$$T(s) = \frac{1}{2\sqrt{\pi}} \Gamma(-1/2-s)\Gamma(s) \zeta(-1/2-s).$$

Now apply Mellin inversion, shifting the integral

$$\frac{1}{2\pi i}\int_{-7/4-i\infty}^{-7/4+i\infty} T(s)/x^s ds$$

to the right to obtain an expansion at infinity.

We obtain that

$$\operatorname{Res}(T(s)/x^s; s=-3/2) = -\frac{2}{3} x^{3/2},$$

$$\operatorname{Res}(T(s)/x^s; s=-1) = -\frac{1}{2} \zeta(1/2) x,$$

(this residue does not contribute being cancelled by the term that we introduced to shift the fundamental strip of $g(x)$)

$$\operatorname{Res}(T(s)/x^s; s=-1/2) = -\frac{1}{2} x^{1/2},$$

$$\operatorname{Res}(T(s)/x^s; s=0) = -\zeta(-1/2),$$

$$\operatorname{Res}(T(s)/x^s; s=1/2) = -\frac{1}{24} x^{-1/2}.$$

The remaining residues have the form

$$\operatorname{Res}(T(s)/x^s; s=2q+1/2) =

\frac{1}{2\sqrt{\pi}}\Gamma(2q+1/2)\zeta(-2q-1)\frac{x^{-2q-1/2}}{(2q+1)!}.$$

Here we use $q\ge 1.$ The reader may wish to simplify these.

This yields the asymptotic expansion

$$S(n) \sim

2/3\,{n}^{3/2}+1/2\,\sqrt {n}+\zeta \left( -1/2 \right) +

1/24\,{\frac {1}{\sqrt {n}}}

-{\frac {1}{1920}}\,{n}^{-5/2}+{\frac {1}{9216}}\,{n}^{-9/2} +\cdots$$

This is as it ought to be and here Mellin transforms really shine. Mellin-Perron and Wiener-Ikehara only give the first few terms while Euler-MacLaurin fails to produce the constant. The following MSE link points to a calculation in a very similar spirit.

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.

The form for the asymptotic expansion suggests examining values of $n$ near $36m^2$, where $m\in\mathbb{Z}^+$.

For $a\in\mathbb{Z}$ and $|a|\ll m^2$ we find

$$\begin{equation*}

S(36m^2+a) = 144m^3+(6a+3)m+\frac{a(a+1)}{24m}+\zeta(-1/2) + O(1/m).\tag{1}

\end{equation*}$$

Thus, if $m$ is large and

$$\begin{equation*}

m = \left[-\frac{a(a+1)}{24\zeta(-1/2)}\right],\tag{2}

\end{equation*}$$

where $[\;]$ is the nearest integer function,

the sum itself should be near an integer.

The expansion (1) is consistent, since for this choice of $m$ we must have $|a|\sim\sqrt{m}\ll m^2$.

The error introduced by (2) is $O(1/m)$.

Thus, the sum for this choice of $n$ will be within $O(1/m)\sim O(1/n^{1/2})$ of an integer.

Below we give the distance to the nearest integer to the seventh decimal place for some values of $n$.

$$\begin{array}{lll}

a & n & |S(n)-[S(n)]| \\ \hline

2 & 38 & 0.0462347 \\

4 & 580 & 0.0019127 \\

8 & 7064 & 0.0068525 \\

16 & 108916 & 0.0017046 \\

32 & 1618016 & 0.0003070 \\

64 & 25040080 & 0.0000443 \\

128 & 394419728 & 0.0000292

\end{array}$$

To complete this calculation we need to show how to compute

$$g^*(s) = \mathfrak{M}(\sqrt{x+1}; s).$$

This is

$$\int_0^\infty \sqrt{x+1} x^{s-1} dx.$$

Now put $x+1 = 1/t$ to get

$$ g^*(s) = \int_1^0 \frac{1}{\sqrt{t}} \frac{(1-t)^{s-1}}{t^{s-1}}

\left(-\frac{1}{t^2}\right) dt \\ =

\int_0^1 t^{-1/2-s+1-2} (1-t)^{s-1} dt =

\int_0^1 t^{-s-3/2} (1-t)^{s-1} dt.

$$

This last integral is a beta function term and equal to

$$B(-s-1/2, s) = \frac{\Gamma(-s-1/2)\Gamma(s)}{\Gamma(-1/2)} =

-\frac{\Gamma(-s-1/2)\Gamma(s)}{2\sqrt{\pi}}.$$

This was to be shown.

- minimizing the sum of weighted absolute distance
- Is every symmetric bilinear form on a Hilbert space a weighted inner product?
- About Lusin's condition (N)
- Finding the Maximum and Minimum values w/constraint
- A question by Ramanujan about a relational expression of a triangle
- Prove that there is an irrational number and a rational number between any two distinct real numbers
- Can I use the “Secretary Problem” to find the worst candidate, too?
- How prove $\frac{(k+1)^{k+1}}{k^k}\sum_{t=k+1}^{n}\frac{1}{t^2}<e$
- Compute the infinite product $\prod\limits_{n=2}^\infty \left(1+\frac{1}{2^n-2}\right)$
- Convex combination
- Prove$\overline{(A \cap B \cap C)} = \overline{A} \cup \overline{B} \cup \overline{C}$ By Subsets
- Please verify this definition of locally convex vector space
- Max and min value of $7x+8y$ in a given half-plane limited by straight lines?
- Christoffel symbols and fundamental forms
- Proving $ { 2n \choose n } = 2^n \frac{ 1 \cdot 3 \cdot 5 \cdots (2n-1)}{n!} $