# Show that the interval $\left[ \frac{-1+\sqrt{1+8m}}{2}, \frac{1+\sqrt{-7+8m}}{2} \right]$ contains exactly one integer

Question: Given any integer $$m\geq 1$$, is it true that the interval $$\left[ \frac{-1+\sqrt{1+8m}}{2}, \frac{1+\sqrt{-7+8m}}{2} \right]$$ contains exactly one integer only?

From graphing, this seems to be true. However, I do not know how to prove it.

• It's an interval of length $1-O(1/\sqrt m)<1$ so it will never have two integers, and one would expect almost all $m$ to give exactly one integer. – Angina Seng Sep 17 at 2:05
• Interval of length $<1$ might contains no integer.... – Idonknow Sep 17 at 2:06
• Isn't this a more relevant graph? The two bounds are equal only when $m = 1$. – Jeremy Lindsay Sep 17 at 2:07
• If $m=\dfrac{n(n+1)}2$, then $n=\dfrac{-1+\sqrt{1+8m}}2$; if $m=\dfrac{n(n+1)}2+1$, then $n+1=\dfrac{1+\sqrt{-7+8m}}2$ – J. W. Tanner Sep 17 at 2:09

As the length of the interval is less than $$1$$, there can be at most one integer in the interval. We now show that there always exists one.
If there is no integer in the interval, then there is an integer $$k$$ such that $$k< \frac{-1+\sqrt{1+8m}}{2}$$ and $$\frac{1+\sqrt{-7+8m}}{2} < k + 1$$.
This is equivalent to $$(2k + 1)^2 < 1 + 8m$$ and $$(2k + 1)^2 > -7 + 8m$$.
However we know that $$(2k + 1)^2$$ is congruent to $$1$$ mod $$8$$, so it cannot lie between $$1 + 8m$$ and $$-7 + 8m$$.
• @J.W.Tanner See the first comment by Angina Seng. The interval has length $< 1$ so there is at most one. – WhatsUp Sep 17 at 2:48