## Task A-3.4.

Determine all rational numbers $x$ for which

$$
x \cdot\lfloor x\rfloor \cdot(x-\lfloor x\rfloor)=254
$$

For a rational number $t$, $\lfloor t\rfloor$ is the greatest integer not greater than $t$. For example, $\lfloor 3.14\rfloor=3$, $\lfloor-3.14\rfloor=-4$.
## Solution.

Let's write the number $x$ in the form

$$
x=n+\frac{p}{q}
$$

where $n \in \mathbb{Z}$, $p \in \mathbb{N}_{0}$, and $q \in \mathbb{N}$ such that $p$ and $q$ are relatively prime, and $p < q$. If there were a prime number $d > 1$ that divides both $q^{2}$ and $n q + p$, it would also divide $n q$, and thus would have to divide $p$. Therefore, we conclude that the only possibility is $q^{2} \mid n$.

Thus, there exists $k \in \mathbb{Z}$ such that $n = k q^{2}$. Using this new unknown, we rearrange the equation:

$$
\begin{aligned}
\left(k q^{3} + p\right) \cdot k q^{2} \cdot p & = 254 q^{2} \\
\left(k q^{3} + p\right) \cdot k \cdot p & = 254
\end{aligned}
$$

The prime factorization of 254 is $254 = 2 \cdot 127$, so the only possible factorizations of this number into positive factors are $1 \cdot 2 \cdot 127$ and $1 \cdot 1 \cdot 254$.

First, assume that $p$ is the largest in absolute value among the factors $k q^{3} + p$, $k$, and $p$, i.e., $p \geq 127$. Then the other two factors are at most 2 in absolute value. Therefore, we have

$$
q^{3} \leq \left|k q^{3}\right| \leq \left|k q^{3} + p\right| + p \leq 2 + p \leq 256
$$

However, on the other hand, $q > p \geq 127$, which leads to a contradiction.

Now, assume that $k$ is the largest in absolute value among the factors $k q^{3} + p$, $k$, and $p$, i.e., $|k| \geq 127$. Again, the other two factors are at most 2 in absolute value, so

$$
q^{3} = \frac{\left|k q^{3}\right|}{|k|} \leq \frac{\left|k q^{3} + p\right| + p}{|k|} \leq \frac{3}{127} < 1,
$$

which leads to a contradiction with $q \in \mathbb{N}$.

Therefore, we conclude that $k q^{3} + p$ is the largest in absolute value. Thus, we have one of the three cases:

$$
\begin{aligned}
& \left|k q^{3} + p\right| = 127, |k| = 1, p = 2, \quad \left|k q^{3} + p\right| = 127, |k| = 2, p = 1 \\
& \quad \text{or} \quad \left|k q^{3} + p\right| = 254, |k| = 1, p = 1
\end{aligned}
$$

In the first case, $k q^{3} + p = \pm 127$, $k = \pm 1$, $p = 2$. Then $q^{3} = 125$ or $q^{3} = 129$. Only the first possibility gives a solution $q = 5$, so $n = 5^{2} + \frac{2}{5} = \frac{127}{5}$.

In the second case, $k q^{3} + p = \pm 127$, $k = \pm 2$, $p = 1$. Then $q^{3} = 63$ or $q^{3} = 64$. Only the second possibility gives a solution $q = 4$, so $n = -2 \cdot 4^{2} + \frac{1}{4} = \frac{-127}{4}$.

In the third case, $k q^{3} + p = \pm 254$, $k = \pm 1$, $p = 1$. Then $q^{3} = 253$ or $q^{3} = 255$, which does not lead to any new solutions.

We conclude that all solutions for $n$ in the original equation are

$$
\frac{127}{5} \quad \text{and} \quad \frac{-127}{4}
$$

Note: The claim that $k q^{3} + p$ is the largest in absolute value among the factors can also be proven by considering the cases where all factors are positive and where two factors are negative. Proving the claim in each of these cases earns 1 point, corresponding to the sixth and seventh points in the above scoring scheme.