Find all triples $(x,a,b)$ where $x$ is a real number, and $a,b$ are integers belonging to $\{1,2,\dots,9\}$ such that $$x^2-a\{x\}+b=0$$ Here $\{x\}$ denotes the fractional part of $x$.

My contention, which I know is wrong, is that the equation has no solutions.

Reason: If $x$ has $0$ fractional part, this clearly has no solutions. Let us suppose now that $x$ has a fractional part that runs upto $n$ decimals. Then $\{x\}$ also has a fractional part which runs up to $n$ decimals. Consequently, $x^2$ has a fractional part that runs up to $2n$ decimals, and $a\{x\}$ has a fractional part that runs only up to $n$ decimal places (as $a$ is an integer). Hence, $x^2-a\{x\}$ has a non-zero fractional part (at least in the $n+1$ to $2n$ decimal places), which implies $x^2-a\{x\}+b$ can never be $0$ as it has a fractional part.

Where in this argument am I going wrong?

  • 2
    $\begingroup$ I think you are assuming that $x$ is rational. $\endgroup$ – rogerl Feb 21 at 1:29
  • $\begingroup$ @rogerl You are likely correct as irrational numbers never have a fixed # of digits. However, note that even rational numbers are often repeating decimals, so they also don't necessarily have just $n$ digits for some natural number $n$. $\endgroup$ – John Omielan Feb 21 at 1:31
  • 1
    $\begingroup$ @JohnOmielan True, of course. But there are no solutions in rational numbers (this is not hard to see - if $p/q$ is a rational solution, write $p = dq+r$, $0\le r<q$, and simplify). But you are correct, I probably should have said that the OP is assuming that $x$ is a terminating decimal. $\endgroup$ – rogerl Feb 21 at 1:35
  • 1
    $\begingroup$ x²-3x+1 has a solution between 0 and 1. So there is at least 1 solution to the problem. Try a graphical approach ? $\endgroup$ – ama Feb 21 at 1:54

As for where in your argument you went wrong, as stated in the comments, you can't necessarily assume that $x$ is a terminating decimal.

As to determine what values will work, let

$$x = c + r \text{ where } c \in \mathbb{Z} \text{ and } 0 \le r \lt 1 \tag{1}\label{eq1}$$

This gives

$$\left(c + r\right)^2 - ar + b = 0 \tag{2}\label{eq2}$$

Expanding this and collecting into powers of $r$ terms gives

$$r^2 + \left(2c - a\right)r + \left(c^2 + b\right) = 0 \tag{3}\label{eq3}$$

First, note that as $r \ge 0$, $c^2 \ge 0$ and $b \gt 0$, this means that

$$2c - a \lt 0 \tag{4}\label{eq4}$$

Solving for $r$ using the quadratic formula gives

$$r = \frac{-\left(2c - a\right) \pm \sqrt{\left(2c - a\right)^2 - 4\left(c^2 + b\right)}}{2} \tag{5}\label{eq5}$$

The $r$ inequality in \eqref{eq1} gives that

$$0 \le -\left(2c - a\right) \pm \sqrt{\left(2c - a\right)^2 - 4\left(c^2 + b\right)} \lt 2 \tag{6}\label{eq6}$$

Due to \eqref{eq4}, plus that $c^2 + b \gt 0$, the left side of \eqref{eq6} will always be true. As such, consider the right side. From \eqref{eq4}, to be able to add the square root means that $2c - a = -1$. However, this makes the discriminant $1 - 4\left(c^2 + b\right) \lt 0$, so $r$ won't be real. Thus, only subtracting the square root can possibly work. Thus, moving the square root term to the right side and the $2$ to the left gives

$$-\left(2c - a\right) - 2 \lt \sqrt{\left(2c - a\right)^2 - 4\left(c^2 + b\right)} \tag{7}\label{eq7}$$

Next, since $2c - a < -1$, as discussed above, then both sides are non-negative so we can square each side to get

$$\left(2c - a\right)^2 + 8c - 4a + 4 \lt \left(2c - a\right)^2 - 4\left(c^2 + b\right) \tag{8}\label{eq8}$$

Simplifying by removing the common first term on both sides and dividing by $4$ gives

$$2c - a + 1 \lt -c^2 - b \tag{9}\label{eq9}$$

This becomes

$$c^2 + 2c + 1 \lt a - b \Rightarrow \left(c + 1\right)^2 \lt a - b \tag{10}\label{eq10}$$

As $\left(c + 1\right)^2 \ge 0$, this means $a \ge b$ and it limits the possible values of $c$ as $-2 \le c + 1 \le 2$ since $a - b \lt 9$, so $c$ can only be one of $-3, -2, -1, 0, 1$. You should be able to finish this now by checking these few values of $c$ to determine the appropriate values for $r$, thus $x$, plus $a$ and $b$, where the value $r$ obtained in \eqref{eq5} is real, with this requiring that $a^2 - 4ac - 4b \ge 0$.

  • $\begingroup$ Just an added question. Can a number of the form $f(f+n)$, where $0<f<1$ is a fraction and $n$ is an integer, ever be an integer? $\endgroup$ – Anju George Feb 21 at 3:03
  • $\begingroup$ @AnjuGeorge Yes, it can quite easily be any integer $1 \le m \le n$ if you allow $f$ to be a real value between $0$ and $1$. However, if you restrict $f$ to be a rational number, then this is not so simple to determine. Is this what you are actually asking about? $\endgroup$ – John Omielan Feb 21 at 3:06
  • $\begingroup$ @AnjuGeorge Note that for $f$ being restricted to rational values, it'll never be true. A hint is to express $f$ as a fraction in lowest terms. See if you can determine the rest yourself. $\endgroup$ – John Omielan Feb 21 at 3:20

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.