<s>[INST] How prove this$\lfloor \sqrt{2x-\lfloor\sqrt{2x}\rfloor}\rfloor=\lfloor\frac{\sqrt{8x+1}-1}{2}\rfloor$ Question:

let $x\ge 0$, show that
  $$\lfloor \sqrt{2x-\lfloor\sqrt{2x}\rfloor}\rfloor=\lfloor\dfrac{\sqrt{8x+1}-1}{2}\rfloor$$

My idea: let $\lfloor \sqrt{2x}\rfloor =m$
then
$$\sqrt{2x}-1<m\le \sqrt{2x}$$
so
$$m^2\le 2x<(m+1)^2$$
so
$$2x-\lfloor\sqrt{2x}\rfloor\in [m^2-m,m^2+m+1)$$
so
$$\lfloor \sqrt{2x-\lfloor\sqrt{2x}\rfloor}\rfloor=m $$or
$$\lfloor \sqrt{2x-\lfloor\sqrt{2x}\rfloor}\rfloor=m-1$$
But Right is eigher is $m$ or $m-1$,then How prove LHS=RHS?
so follow I can't,can you help?Thank you
 [/INST] Note that $\frac{\sqrt{8x+1}-1}{2}=\sqrt{2x+\frac 14}-\frac 12$.
We know that the LHS equals $m$ or $m-1$. Suppose that the LHS equals $m$. Then
$$m\le \sqrt{2x-m}< m+1$$
Thus
$$m^2+m\le 2x < (m+1)^2+m$$
So the RHS satisfies
$$\sqrt{m^2+m+\frac 14}-\frac 12\le \sqrt{2x+\frac 14}-\frac 12<\sqrt{(m+1)^2+m+\frac 14}-\frac 12$$
Note that $\sqrt{m^2+m+\frac 14}-\frac 12=\sqrt{(m+\frac 12)^2}-\frac 12=m$. We also have
$$\sqrt{(m+1)^2+m+\frac 14}-\frac 12< m+1$$
as can be checked by adding $\frac 12$ and squaring on both sides. After cancelling we are then left with $0<1$, a true statement.
Thus the RHS also equals $m$. An analogous calculation shows that the RHS is $m-1$ if the LHS is $m-1$.
</s>