Enter a 3 or 4 digit number, the code will rearrange the digits from greatest to least and least to greatest, then subtract the two new numbers and repeat until it ends up with 0, 495, or 6174.
HarryB178