Finding all rational values of $x$ for which $256(x + 15\{x\})\{x\} = 2021$
Find all rational numbers $x$ that satisfy $$256(x + 15\{x\})\{x\} = 2021$$ where $\{x\}$ is the fractional part of $x.$
I first substituted in $x - \lfloor x \rfloor = \{x\},$ which gave me $$256(16x - 15\lfloor x \rfloor)(x - \lfloor x \rfloor) = 2021$$ after simplifying. However, from here, I got stuck.
Solution 1:
Assuming that $x=\lfloor x\rfloor+\{x\}$, this is equivalent to $$ (\lfloor x\rfloor+16\{x\})\{x\}=\frac{2021}{256} $$ Let $n=\lfloor x\rfloor\in\mathbb{Z}$ and $t=\{x\}\in[0,1)$. Then we need to solve $$ 16t^2+nt-\frac{2021}{256}=0 $$ which by the quadratic formula gives $$ t=\frac{-2n\pm\sqrt{4n^2+2021}}{64} $$ To ensure that $t\ge0$, we need to take the positive square root.
If $\sqrt{4n^2+2021}\in\mathbb{Q}$, then $\sqrt{4n^2+2021}\in\mathbb{Z}$. So we must have a positive $m\in\mathbb{Z}$ so that $$ (m-2n)(m+2n)=43\cdot47=1\cdot2021 $$ This leaves us with $$\require{cancel} \begin{array}{l} &&t=\frac{m-2n}{64}&x=n+t\\\hline n=1&m=45&t=\frac{43}{64}&x=\frac{107}{64}\\ n=-1&m=45&t=\frac{47}{64}&x=-\frac{17}{64}\\ n=505&m=1011&t=\frac1{64}&x=\frac{32321}{64}\\[-3pt] n=-505&m=1011&\hspace{-1.5mm}\cancel{t=\frac{2021}{64}} \end{array} $$
Solution 2:
Hint: Let $\{x\} = a/b$ in lowest terms, $x = y + a/b$ where $y$ is an integer.
Then $x + 15 \{x\} = y + 16 a/b$ and the equation becomes
$$ 256 \left( b y + 16 a\right) \frac{a}{b^2} = 2021 $$
Conclude that $b$ must be a power of $2$...