<s>[INST] Floor function bounding From CMC:

What is the sum of the square of the real numbers $x$ for which $x^2 - 20\lfloor x\rfloor + 19 = 0$?

We use $\lfloor x\rfloor\le x<\lfloor x\rfloor+1$ and eventually get the bounds $1\le x\le19$ and $x\ge 18,x\le 2.$ Of course, it's possible for $x$ not to be an integer, so how do we find the other solutions, other than $19$ and $1$?
Someone wrote this solution:

$x^2 - 20\lfloor x \rfloor + 19 = 0$
Cleary $x\geq \lfloor x \rfloor$ for all real $x$. Thus,
$$x^2-20x+19 \leq x^2 - 20\lfloor x \rfloor + 19=0.$$
Which leads to
$$1 \leq x \leq19.$$Also $x^2=20\lfloor x\rfloor - 19$ which implies $\lfloor x \rfloor=1,17,18,19$.

I'm not sure how we get $\lfloor x\rfloor=17,18$ from this.
 [/INST] From $\lfloor x\rfloor=(x^2+19)/20\gt0$, we see that we must have $x\gt0$, hence $x=\sqrt{20\lfloor x\rfloor-19}$ (i.e., the positive, not the negative, square root). It follows that $x^2-20\lfloor x\rfloor+19=0$ has a (unique) solution with $\lfloor x\rfloor=n\in\mathbb{Z}^+$ if and only if $n\le\sqrt{20n-19}\lt n+1$. With everything in sight non-negative, we have
$$\begin{align}
n\le\sqrt{20n-19}\lt n+1
&\iff n^2\le20n-19\lt n^2+2n+1\\
&\iff n^2-20n+19\le0\lt n^2-18n+20
\end{align}$$
The first quadratic inequality in the last line tells us $1\le n\le19$; the second tells us either $n\lt9-\sqrt{61}$ or $n\gt9+\sqrt{61}$, which, since $7\lt\sqrt{61}$, tells us either $n\lt2$ or $n\gt16$. We thus have four values for $\lfloor x\rfloor=n$, namely $1$, $17$, $18$, and $19$, with $20n-19$ for the corresponding values of $x^2$. The sum of these squares is
$$(20\cdot1-19)+(20\cdot17-19)+(20\cdot18-19)+(20\cdot19-19)=20(1+54)-76=1024$$
(The fact that the final answer turns out to be a power of $2$ is surely pure coincidence.)
</s>