Problem. I am attempting to find a generalized result for the sum $$S(a, b) = \displaystyle\sum_{k=a}^b \sqrt{k},$$ i.e. a function (= closed expression in elementary functions) $T(a, b)$ such that $$\lfloor S(a, b) \rfloor = \lfloor T(a, b) \rfloor$$ for all $0 < a < b$.
This question is inspired from a Romanian math olympiad problem:
Let $N= \sqrt{5} + \sqrt{6} + \sqrt{7} + \cdots + \sqrt{13}$. Without approximating the square roots, show that the whole part of $N$ is 26.
A proof idea I had was to use the Euler-Maclaurin formula, and then adding enough terms to bound the error uniformly over all $a, \, b$. The formula is:
$$ \displaystyle\sum_{k=a}^b f(k) = \displaystyle\int\limits_a^b f(x) \; \mathrm dx + \frac{f(b) + f(a)}{2} + \sum_{k=1}^{\left\lfloor \frac{p}{2}\right\rfloor} \frac{B_{2k}}{(2k)!} \left(f^{(2k - 1)}(b) - f^{(2k - 1)}(a)\right) + R_p.$$
Here $B_k$ is the $k$th Bernoulli number with $B_1 = 1/2$ and $R_p$ is an error term. The error term can be expressed exactly in terms of the Bernoulli polynomials.
These polynomials are recursively defined by: $$B_0(x) = 1, \quad B_k'(x) = k B_{k-1}(x), \quad \displaystyle\int\limits_0^1 B_k(x) \; \mathrm dx = 0.$$
The periodized Bernoulli functions are:
$$P_k(x) = B_k(x - \lfloor x \rfloor), \quad \text{for } x \in [0,1).$$
The remainder term in the Euler-Maclaurin formula is: $$R_p(a, b) = (-1)^{p+1} \int\limits_a^b \frac{f^{(p)}(x) \, P_p(x)}{p!} \; \mathrm dx.$$
Using the bound on Bernoulli polynomials $$|B_k(x)| \leq \displaystyle\frac{2 k!}{(2\pi)^k} \zeta(k), \quad \text{for } k > 0,$$ we get an estimate for the remainder $$|R_p(a, b)| \leq \frac{2 \zeta(p)}{(2\pi)^p} \displaystyle\int\limits_m^n |f^{(p)}(x)| \; \mathrm dx.$$
The idea is pretty straightforward: use $f(x) = \sqrt{x}$ and enough terms to guarantee that $\lfloor S(a, b) \rfloor = \lfloor T(a, b) \rfloor$.
The first order approximation
$$T_1(a, b) = \left\lfloor \frac{2}{3}(b^{3/2} - a^{3/2}) + \frac{\sqrt{a} + \sqrt{b}}{2} \right\rfloor$$
is not good enough. For example
$$\displaystyle \sum_{k=1}^{49} \sqrt{k} \approx 231.96473279…$$
so $\lfloor S(1, 49) \rfloor = 231$, while $T_1(1, 49) =232$.
Trying to add one more term (so that we get the second order Euler-Maclaurin approximation),
$$T_2(a, b) = \frac{2}{3}\,\left(b^{3/2}-a^{3/2}\right) + \frac{\sqrt a+\sqrt b}{2} + \frac{1}{24}\,\left(\frac1{\sqrt b}-\frac1{\sqrt a}\right)$$
yields a failure at $(a, b) = (1, 156)$ because
$$\displaystyle \sum_{k=1}^{156} \sqrt{k} \approx 1305.00003144…$$
but $T_2(1, 156) \approx 1304.99958433...$, so the floors are not equal.
I could numerically confirm an alternating pattern: odd orders fail at $(1, 156)$, even orders at $(1,761)$. This alternation persists at least up to order 30.
Since the formula is so close, can we add a correction term somehow or prove that enough terms will give the result, i.e. that
$$\lfloor S(a, b) \rfloor = \lfloor T_n(a, b) \rfloor$$
for all $0 < a < b$?
This answer to a similar question says it is enough "to take more terms", but does not offer any proof for that claim.