Finding a palindromic number which is the difference of two palindromic numbers

1.4k Views Asked by At

Let $X$ and $Y$ be two $4$-digit palindromes and $Z$ be a $3$-digit palindrome. They are related in the way $X-Y=Z$. How can we figure out $Z$?

2

There are 2 best solutions below

1
On BEST ANSWER

Hint: Write $X = 1001a + 110b$, $Y = 1001c + 110d$ with $a,b,c,d \in \{0,\ldots, 9\}$, without loss of generality we may assume $a \ge c$. Then $$ Z= X-Y = 1001(a-c) + 110(b-d) $$ Now note: Can $a-c > 1$ hold? Can $a - c = 0$ hold? Now check for which value of $k := d-b$ we have that $1001 - 110k$ is a palindrome.

1
On

Let $X=abba$, $Y=cddc$, and $Z=efe$. Then we can think of it as this:

 abba
-cddc
=====
  efe

Note that since $Z$ is positive, we must have $a\ge c$. However, we can't have $a = c$, because then the ones digits imply that $e=0$ so that $Z$ is actually a two digit number.

Thus, we must have $a>c$. But notice that in the leftmost column, there is a $0$, suggesting that the hundreds digit has to borrow $1$ from the thousands. Thus, we know that $b<d$ and $a=c+1$ so that $e=1$.

Trial and error gives us one possible solution: $\boxed{X=7007,Y=6886,Z=121}$.

It isn't unique though, as this also works: $\boxed{X=5005,Y=4884,Z=121}$