Show the following inequality has exactly one integer solution Problem We have the following inequality. Show that it has only one integer solution for each $n$. $$k^2+k-2\le2n\le k^2+3k-2$$
Attempt Solving this inequality, I got $$\frac{1}{2}\left(\sqrt{8n+17}-3\right)\leq k\leq\frac{1}{2}\left(\sqrt{8n+9}-1\right)$$ Taking the difference doesn't work since the difference is less than one. What should I do to show that $k$ can only take one integer value.

Notice that $(k+1)^2 + (k+1) - 2 = k^2+3k$, so the intervals $[k^2 + k - 2, k^2+3k)$, where $k$ is a non-negative integer are disjoint and cover $\mathbb{R^+}$ entirely. This means that $$k^2 + k - 2 \leq n < k^2 + 3k$$ always have exactly one solution for $k$ for each non-negative integer $n$. Since $k$ and $n$ are integers, this is the same as $$k^2 + k - 2 \leq n \leq k^2 + 3k - 1$$ Use the fact that $2n$ is pair to conclude that you can take one unit from the rhs of the inequality on the right.
