Kaprekar's constant is the value 6174 (Deutsch and Goldman 2004). When leading 0s are retained to keep four decimal digits
at every step, the Kaprekar routine reaches 6174
from every four-digit starting number whose digits
are not all equal, in at most 7 iterations (Nishiyama
2006). An iteration is one subtraction,
excluding the initial value from the count. The value 6174 is a fixed
point, since .
The bound of 7 iterations is attained, for example, by
The shorter example
is illustrated by Numberphile (2011).
If leading 0s are instead discarded after each subtraction, exactly 77 starting numbers from 1000 through 9999 reach 0, while the remaining 8923
reach 6174 in at most 7 iterations. For example, 1000
then gives , whereas retaining four digits
gives
.