Finding the values of $x$ such that $[x^2]=[x]^2$ ($[\cdot]$ denotes the floor function) I was trying to find the values of $x$ that makes the equation $[x^2]=[x]^2$ true where $[\cdot]$ denotes the floor function. I tried doing the following:
Let $x=n+r$ where $n=[x]$ and $0\leq\ r<1$. Then $x^2=n^2+2nr+r^2$ which implies that $[x^2]=[n^2+2nr+r^2]=n^2+[2nr+r^2]=[x]^2=n^2$. Subtracting both sides of the equation by $n^2$ I obtained $[2nr+r^2]=0$ if and only if $0\leq\ 2nr+r^2<1$. I got stucked in here. Any suggestions or hints that can you give me?
 A: Write $x=n+r$, where $n\in\mathbb{Z}$ and $0\le r\lt1$. Then we want
$$
\left\lfloor n^2+2nr+r^2\right\rfloor=\left\lfloor(n+r)^2\right\rfloor=\lfloor n+r\rfloor^2=n^2\tag1
$$
If $r=0$, then $(1)$ is true. Thus, we have any $x\in\mathbb{Z}$ is a solution.
Now, assume $0\lt r\lt1$. $(1)$ requires
$$
0\le2nr+r^2\lt1\tag2
$$
To satisfy the left-hand inequality of $(2)$, we need
$$
2n+r\ge0\tag3
$$
So we need $n\ge0$. To satisfy the right-hand inequality of $(2)$, we need
$$
0\lt r\lt-n+\sqrt{n^2+1}\tag4
$$
which is equivalent to
$$
n\lt x\lt\sqrt{n^2+1}\tag5
$$
Therefore, we get the complete solution set to be
$$
x\in\mathbb{Z}\cup\bigcup_{n=0}^\infty\left(n,\sqrt{n^2+1}\right)\tag6
$$
A: $$0\leq\ 2nr+r^2<1$$
Solve$$ 2nr+r^2-1=0$$ for $r$ in terms of $n$.
$$ r=-n\pm \sqrt {n^2+1} $$
For $$-n- \sqrt {n^2+1} <r< -n+\sqrt {n^2+1}$$
We get $$0\leq\ 2nr+r^2<1$$
Since $r\ge 0$, we just need $$ r< -n+\sqrt {n^2+1}$$
For example if $n=10$, we have to have $r<\sqrt {101}-10 \approx 0.049875$ 
A: I'm not sure there is going to be a "clean" solution of this, you will have to consider various cases.


*

*If $r=0$ the inequalities are clearly true.

*If $r>0$ and $n<0$ then $2n\le-2$ so $2n+r<0$ so $2nr+r^2<0$ and there is no solution.

*The remaining case is $r>0$ and $n\ge0$.  Then $0\le2nr+r^2$ is certainly true, so you have to solve $2nr+r^2<1$ to find $r$ in terms of $n$.


See if you can finish it from here.
A: I think that you have done almost everything. In your notation you have the following inequalities: $r>=0$, $r<1$, $r^2+2nr-1<0$. The last one gives $r<\sqrt{n^2+1}-n$. This gives possible values of $r$ for given $n>=0$. For negative $n$ your computation is not correct. 
