The
Kaprekar's routine algorithm is defined as follows for three-digit numbers: • Take any three-digit number, other than
repdigits such as 111. Leading zeros are allowed. • Arrange the digits in descending and then in ascending order to get two three-digit numbers, adding leading zeros if necessary. • Subtract the smaller number from the bigger number. • Go back to step 2 and repeat. Repeating this process will always reach 495 in a few steps. Once 495 is reached, the process stops because 954 – 459 = 495. The number
6174 has the same property for the four-digit numbers, albeit has a much greater percentage of workable numbers. ==See also==