Sum(i=0..n, a[i]*10^i)
A power of 10 (10^n) can be re written as
(1 + 9 * Sum(i=0..n-1, 10^i).
When you subtract two numbers with the same digits, you end up being able to factor a nine out of these sums fairly easily.
I wrote a proof of the number - reverse(number) a while back. It can be found on archive.org
http://web.archive.org/web/20050314023901/http://jimfl.tense...