Fun with Math

Media_http2bpblogspot_xtakh

Neatorama today had links to "Kaprekar's operation" and the Mysterious number 6174. Here's how it goes:  

First choose a four digit number where the digits are not all the same (that is not 1111, 2222,...). Then rearrange the digits to get the largest and smallest numbers these digits can make. Finally, subtract the smallest number from the largest to get a new number, and carry on repeating the operation for each new number. Keep repeating this and you'll always get 6174.

example:
1952
9521-1259=8262
8622-2268=6354
6543-3456=3087
8730-0378=8352
8532-2358=6174