Find the integers that double if the first and last digits are swapped

96 Views Asked by At

Find the integers that double if their first and last digits are swapped.

In other words find the digits: $a$, $b$ and $n_1$ ... $n_m$ in such a way that:

[$a$ $n_1$ $n_2$ ... $n_m$ $b$] $\times$ $2$ = [$b$ $n_1$ $n_2$ ... $n_m$ $a$]

For example, using the rule above: $25$ turns into $52$ but unfortunately $52 \gt 25 \times 2$. The number $102$ transforms into $201$ but again $102 \times 2 \gt 201$.

UPDATE

Possible solution:

Case 1: the number ends in $1$ and in consequence its double ends in $2$

$\ldots 1 \times 2$

$\ldots2$

In conclusion the pair must be:

$2 \ldots 1 \times 2$

$1 \ldots 2$ (impossible)

Case 2: the number ends in $2$

$4 \ldots 2 \times 2$

$2 \ldots 4$ (impossible)

Case 3:

$6 \ldots 3 \times 2$

$3 \ldots 6$ (impossible)

Case 4:

$8 \ldots 4\times 2$

$4 \ldots 8$ (impossible)

Case 5:

$0 \ldots 5 \times 2$ (the first digit can not be zero)

$5 \ldots 0$

Case 6:

$2 \ldots 6 \times 2$

$6 \ldots 2$ (impossible)

Case 7:

$4 \ldots 7 \times 2$

$7 \ldots 4$ (impossible)

Case 8:

$6 \ldots 8 \times 2$

$8 \ldots 6$ (impossible)

Case 9: the number ends in $9$

$8 \ldots 9 \times 2$

$9 \ldots 8$ (impossible)

Case 10: the number ends in $0$

$0 \ldots 0 \times 2$ (the number can not start with $0$)

$0 \ldots 0$

1

There are 1 best solutions below

0
On

I'll give an algebraic proof. Your answer is good, though.

Given a number $l$, greater than $10$ since this is obviously not true for single digit numbers, write it as $l = 10^nx + 10y + z$, where $x$ and $z$ are single digit numbers i.e. $10^n \leq l < 10^{n+1}$. Essentially, we are isolating the first and last digits separately (for example, $166465 = 1 \times 10^5 + 6646 \times 10 + 5$)

Now, from the given condition, $2l = 10y + 10^n z + x$, since we have only swapped the last two digits. Of course, by ordinary multiplication, this is also equal to $2 \times 10^n x + 20y + 2z$, by multiplying the expression for $l$ by $2$.

Consequently, $10y + 10^n z + x = 2\times 10^n x + 20y + 2z$. A few transpositions give $10y = (10^n - 2) z - (2 \times 10^n-1)x$.

The last digit of the left hand side is $0$. Therefore, so is the last digit of the number on the right hand side. Note that $n \geq 1$, since we know $l$ has two digits. This gives the last digit of the right hand side as the last digit of $x - 2z$.

Consequently, $x - 2z$ must have last digit zero. That is, either $x = 2z$, or $x = 2z - 10$ (note that $-20 < x - 2z < 10$).


But $y \geq 0$, so $z \geq \frac{(2 \times 10^n - 1) x}{10^n - 2} \geq 2x \geq x$. So $x = 2z - 10$ is the only possibility : the other forces $x \geq z$.

But if $x = 2z - 10$ then $10 y = 10^n z - 2z - 2(10^n)(2z - 10) + 2z - 10 = - 3 \times 10 ^n z + 2 \times 10^{n+1} - 10$, and dividing by $10$ gives $y = 2 \times 10^n - 3 \times 10^{n-1}z - 1 = 10^{n-1}(20- 3z) - 1$.

This forces $z \leq 6$ from $y \geq 0$. Also, note that $2z - 10 \geq 0$ so $z \geq 5$.

Note that $z = 6$ is ruled out since this gives $x = 1$ but $x$ is the last digit of an even number, hence is even.

But if $z = 5 $ then $x = 0$, but $x \neq 0$ by assumption that $10^n \leq l$.

Thus, no such $l$ exists.