Solve $\lfloor \sqrt x \rfloor = \lfloor x/2 \rfloor$ for real $x$

Note that $\lfloor{\sqrt{x}}\rfloor$ changes value (increases by one) only when $x$ is a perfect square, while $\lfloor{x/2}\rfloor$ changes value only when $x$ is an even integer. Both sides of the equation are initially $0$ (at $x=0$). The first few changes are at $x=1$ (a perfect square, breaking the equality), $x=2$ (an even integer, restoring the equality), $x=4$ (both a perfect square and an even integer, preserving the equality), and $x=6$ (an even integer, breaking the equality). Thus far the intervals $[0,1)$ and $[2,6)$ satisfy the equality, and at this point the left-hand side is smaller than the right. It's not hard to see that even integers are more numerous than perfect squares from here on out, so the complete solution set is $[0,1) \cup [2,6)$.


It is completely obvious that $x$ must be a non-negative real number. We decompose it as the following format:

$$x=k^2+n+r$$

in which $k^2$ is the largest integer less than or equal to $x$ in which is a squre of an integer number. So it is completely apparent that

$$n<(k+1)^2-k^2\rightarrow n<2k+1$$ $r$ is a real number such that $0\leq r<1$

We can say that $k\leq\sqrt{x}<k+1$, hence $\lfloor \sqrt{x}\rfloor=k$.

So the problem reduces to $k=\lfloor \frac{k^2+n+r}{2}\rfloor$.

So from the above eqaulity we can deduce

$\lfloor\frac{k^2}{2}\rfloor\leq k$, but for $k\geq 3$, the left hand side of the inequlity grows much faster than the right hand side, hence it is true only for three values for $k$. In other words $k=0,1,2$.

$k=0:$

In this case $n<2k+1=1$, hence we can say that $n=0$, so we have $$k=\lfloor \frac{k^2+n+r}{2}\rfloor\rightarrow 0=\lfloor\frac{r}{2}\rfloor\rightarrow 0\leq r<2$$ which is a true inequlity for all values of $r$(note that at the first we assumed $0\leq r<1$).

So in this case $x$ reduces to $k^2+n+r=0+0+r=r$ for all values of $r$, so $x\in[0,1)$

$k=1:$

In this case we have

$$k=\lfloor \frac{k^2+n+r}{2}\rfloor\rightarrow 1=\lfloor\frac{1+n+r}{2}\rfloor$$ In addition we have $$n<2k+1=3\rightarrow n=0,1,2$$ We can say $$1=\lfloor\frac{1+n+r}{2}\rfloor\rightarrow 1\leq n+r<3$$ in which for $n=0$, this condition is not satisfied, but is satisfied for $n=1,2$. Hence in this case we have:

$$x=k^2+n+r=1+1+r=2+r$$ or $$x=k^2+n+r=1+2+r=3+r$$ So $x\in[2,4)$

$k=2:$

In this case we have $$2=\lfloor\frac{4+n+r}{2}\rfloor\rightarrow 0\leq n+r<2$$ but in this case $n<2k+1=5\rightarrow n=0,1,2,3,4$. But for $n=2,3,4$, the condition of $0\leq n+r<2$ is not satisfied and hence we can say in this case $$x=k^2+n+r=4+n+r=4+0+r\space\space\space\space or\space\space\space x=4+1+r$$ So in this case $x\in[4,6)$

So the solution for the intended equality is the union of these intevals:

$$x\in[0,1)\cup [2,4)\cup [4,6)\rightarrow x\in[0,1)\cup [2,6)$$