Take any four-digit number that does not have all four digits equal. Write its digits in descending order, then in ascending order, and subtract. Repeat. Within seven steps you reach 6174, and then you stay, because 6174 is exactly the number the routine produces from itself: 7641 − 1467 = 6174. The workbench prints that subtraction as 6174, and the interesting part is not the answer but the fact that there is only one place the process can end.
Three digits give the same phenomenon at 495 — starting from 732, the first iteration already lands there: 732 − 237 = 495. Two digits do not give a constant at all (9, 81, 63, 27, 45, 9, … cycles), and five or more digits give a small set of sinks rather than one. Kaprekar also has a family of numbers named after him for a different trick: 45² is 2025, and 20 + 25 = 45.
Answer
6174
How to read it
7641 − 1467, the fixed point of the four-digit routine. The second link is the three-digit constant, reached in one step from 732.
Source
D. R. Kaprekar, a schoolteacher from Devlali, on the four-digit routine in 1949; the three-digit constant 495 is the same construction
Work it in the calculator
These links open the right calculator with this problem's numbers already typed in. The line above is what the screen should show — check it yourself.