The routine
Take a four-digit number whose digits are not all the same — say 3524. Arrange the digits to make the largest number (5432) and the smallest (2345) and subtract: 5432 − 2345 = 3087. Repeat: 8730 − 0378 = 8352. Again: 8532 − 2358 = 6174.
Now try to leave. 7641 − 1467 = 6174. The number is a trapdoor: once you land on it, the routine maps it to itself forever. The Indian mathematician D. R. Kaprekar described this in 1949, and 6174 is called Kaprekar's constant.
Every road leads there
The startling part is that 6174 is not just an example — every four-digit number with at least two different digits reaches it, in at most seven rounds of the routine. Mathematicians have checked them all; there are no exceptions and no escape routes.
Three-digit numbers have their own trapdoor: 495. Try 321: 321 − 123 = 198; 981 − 189 = 792; 972 − 279 = 693; 963 − 369 = 594; 954 − 459 = 495 — and there it stays.
Try it: race to the constant
Each player picks a secret four-digit number, then everyone performs the routine on their own number, counting the steps. Compare: who took the longest road to 6174? (Seven steps is the maximum — see if anyone's number achieves it.)
Then investigate like a mathematician: what goes wrong with a number like 1111, whose digits are all the same? The routine collapses to zero, which is why the rule insists on at least two different digits.

