The 6174 Attractor
Write a whole number from 0 to 9999 using four digits, adding leading zeroes if needed. Arrange its digits from largest to smallest and from smallest to largest, then subtract the smaller arrangement from the larger and repeat. For instance, 3524 gives 5432 − 2345 = 3087. Unless all four digits are identical, this reaches 6174 within seven steps, and the same rule leaves 6174 unchanged.