Ok. I know this isn't a perl question, but I know that some of the monks here are very interessed and good att math so I thought this would be a good place fore this question.
First you take a 6 digit number and make a litteral reverse on that (345612 would be 216543). Then you take the original number and the reversed number and calculate the difference (345612 - 216543 = 129069). Then you remove a digit from the difference (remove the 6 near the end = 12909) and then calculate the sum of all the digits left (1+2+9+0+9 = 21) then you repete this stage on the result until you only get one digit left (2+1 = 3).And now comes the strange stuff. If you take 9 minus the digit you got (9 - 3) you will get the number you removed from the original difference.
NOTE: This works on any number that isn't symetric. And if you don't remove a 9.