I just ran across this today: http://www.trottermath.net/recurops/kaprekar.html I find this pretty neat, so I just had to post it. take any four digit number w/o repreated digits, and re-order from greatest to least, then subtract it's mirror image number from it and repeat, you will end up with 6174. For three digit numbers, you will end up with 495. for two digit numbers, you will end up in a period four cycle... I think. I don't know how five digit numbers work. I just haven't really studied this idea for more than a half hour... I've noticed that the three and four digit numbers add to 18, and since only 99 can add to 18 for two digit numbers, it must cycle through without landing on one specific number, since 99 doesn't have more than one arrangement, for that matter neither does 999 or 9999. I wonder if the number 18 comes up due to the 10 base number system? maybe for any base, this thing will happen as long as the final number's digits all add to 2*(N-1) where N is the base of the number system, also provided it doesn't take repeated digits to add to that number? I kinda want to make a program to map out all the four digit numbers, and find all the interations needed for each four digit number to reach 6174, negating the ones which won't work.