# Role of a difference in generating symmetric palindromes

An example : 923456781-123456789=799999992

Now divide it by the difference between the terminal digits, i.e. 9-1=8

So 799999992/8=99999999

Another example : 52314780-02314785=49999995/5=99999999

But if we do : 799999992/9=88888888 and 49999995/9=5555555

So either the difference or 9 itself help in generating symmetric palindromes

Can this be generalized?

-
Looks like you are the same person as math.stackexchange.com/users/47960/pradip-saha math.stackexchange.com/users/48050/pradip-saha Kindly do not create multiple accounts. I have asked the moderators to merge these accounts. – user17762 Nov 4 '12 at 18:36
Ok, thanks @Marvis, any thoughts on this question.. – Pradip Saha Nov 4 '12 at 18:39

Yes, this idea works fine in general.

Given a positive integer $n$ with at least two digits, define its… "outer flip" $o(n)$ to be the number obtained by swapping its first and last digits, so that $o(123456789)=923456781$, $o(52314780)=02314785$ (note that $o$ is not an involution since $o(o(52314780))=5314782$). Also define $d(n)$ to be the difference of the outer digits of $n$, so that $d(n)=0$ exactly if $n=o(n)$ and $d(n)$ achieves a maximum of $9$ for numbers such as $970$.

Fact 1: If $n\ne o(n)$, then $\left|n-o(n)\right|$ is the number starting with the digit $[d(n)-1]$, ending with the digit $[10-d(n)]$, and enough $9$s in between so that it has the same length (counting the leading zero if $d(n)=1$) as $n$. This follows because all the digits in the middle cancel eachother, and then it's a result of the carrying process for differences like $70002-20007$.

Note that if we pick an $n$ with the desired length and $d(n)$ then this way (as $\left|n-o(n)\right|$) we can obtain all numbers that end with some nonzero digit, "begin" with $9$ minus that digit (possibly $0$) and have an arbitrary (possibly empty) string of $9$s in the middle. Call these numbers "nineish". Define the "modified length" of nineish number to be its actual length if it doesn't end in $9$, and one more than its length if it does (to account for the leading zero).

Fact 2: A nineish number $n$ with last digit $\delta$ is the product of a string of $9$s of length one less than the modified length of $n$ and the one-digit-number $10-\delta$ (this corresponds to $d(m)$ if $n=|m-o(m)|$). To show that something is, say, $9999*7$, it suffices to show that when you add $7$ to it, you get $10000*7$. But this follows from the definition of a nineish number because if you add $10-\delta$ to $\delta$, you get $10$ which carries through the whole string of nines producing zeros until the end where we have the sum $(9-\delta)+1=10-\delta\checkmark$.

Fact 3: A nineish number $n$ with last digit $\delta$ is the product of $9$ and a string of the digit $10-\delta$ with length one less than the modified length of $n$. You can argue this fact directly, but it's easier to use fact 2, which says that $n=999\ldots9*(10-\delta)$, so that $n=9*111\ldots1*(10-\delta)$, but $111\ldots1*(10-\delta)$ is exactly the string we wanted to get after division by $9$.

-