# 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.

• Are you asking if those inequalities have exactly one solution in $k$ or at most one solution? Those are two different things, and I can't tell what you mean from your wording. – Rory Daulton Jun 15 '15 at 19:59
• @RoryDaulton I am saying that they have exact one solution. The original problem in here math.stackexchange.com/questions/1317488/…. – john Jun 15 '15 at 20:00

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.