Simplify this equation

ceiling-and-floor-functionselementary-number-theoryinequality

I'm trying to simplify equation

$$n = \Big\lceil\sqrt{2x +\frac14} – \frac12 \Big\rceil$$

into

$$n = \Big\lfloor\sqrt{2x} + \frac12 \Big\rfloor$$

where $x$ is an integer. Indeed, both equations seem to output the same result when testing for some values. Thus far, I've done:

\begin{align*}
&n = \Big\lceil\sqrt{2x +\frac14} – \frac12 \Big\rceil \\
\implies &\sqrt{2x +\frac14} – \frac12 \leq n < \sqrt{2x +\frac14} + \frac12
\end{align*}

The left side easily reduces as follows:

\begin{align*}
&\sqrt{2x +\frac14} – \frac12 \leq n \\
\implies &\sqrt{2x} – \frac12 < n
\end{align*}

but I'm having trouble with the right side which I would wish to reduce as follows:

\begin{align*}
&n < \sqrt{2x +\frac14} + \frac12 \\
\implies &\texttt{???} \\
\implies &n \leq \sqrt{2x} + \frac12
\end{align*}

so that I'm able to obtain my end result.

\begin{align*}
&\sqrt{2x} – \frac12 < n \leq \sqrt{2x} + \frac12\\
\implies &n = \Big\lfloor\sqrt{2x} + \frac12 \Big\rfloor
\end{align*}

Best Answer

The first gives $$n-1<\sqrt{2x+\frac{1}{4}}-\frac{1}{2}\leq n$$ or $$\left(n-\frac{1}{2}\right)^2<2x+\frac{1}{4}\leq\left(n+\frac{1}{2}\right)^2$$ or $$\frac{n^2-n}{2}<x\leq\frac{n^2+n}{2}$$ and by the same way the second gives: $$n\leq\sqrt{2x}+\frac{1}{2}<n+1$$ or $$\frac{n^2-n}{2}+\frac{1}{8}\leq x<\frac{n^2+n}{2}+\frac{1}{8}$$ and since $x$ is an integer number, we obtain $$\frac{n^2-n}{2}<x\leq\frac{n^2+n}{2}$$ again.