Palindrome Subtraction
A palindrome number is a number that is inverted, but the number remains the same. A four-digit palindrome number is 6226. Suppose, you subtract another four-digit palindrome number from such a four-digit palindrome. Subtraction is also a four-digit palindrome number. For how many four-digit palindrome numbers can that happen?
Here is how I tried:
I am assuming that for all 4-digit palindromes there exists another four four digit palindrome so that their subtraction is also a palindrome(except the smallest one i.e 1001)
Such as 9889-2002 = 7887, 4774-3223 = 1551 and so on.
There are total 90, 4-digit palindromes. As my assumption the answer should be 89 as(90-1). But I am getting the wrong answer, I don't know why....
A four digit palindrome equals $1001a + 110b$, where $1 \leq a \leq 9$ and $0 \leq b \leq 9$. The difference between two palindromes is $1001(a-a’) + 110(b-b’)$. This is itself a palindrome if $a > a’$ (otherwise it’s only three digits, or negative), and $b \geq b’$ (otherwise the first and last digit are different).