Introduction
Take any four-digit number that does not have all four digits the same. Put its digits in descending order, then in ascending order, and subtract the smaller arrangement from the larger. Repeat the process, keeping any leading zeroes. The result eventually reaches 6174, a number known as Kaprekar’s constant. The reason lies in the way the rearrangement and subtraction repeatedly narrow the possible results.
What Is the 6174 Routine?
The procedure is often called the four-digit Kaprekar routine, named after Indian mathematician Dattatreya Ramchandra Kaprekar. It uses a simple cycle of sorting and subtraction:
1. Choose a four-digit number whose digits are not all identical.
2. Arrange its digits from largest to smallest to make one number.
3. Arrange the same digits from smallest to largest to make another number, writing any leading zeroes so both arrangements have four places.
4. Subtract the smaller number from the larger one.
5. Repeat using the result.
For example, start with 3524. Its descending arrangement is 5432, and its ascending arrangement is 2345. Subtracting gives 5432 − 2345 = 3087. The next steps are:
8730 − 0378 = 8352
8532 − 2358 = 6174
Apply the routine once more to 6174. Its digits make 7641 and 1467, and 7641 − 1467 = 6174. From that point, the number stays the same at every step.
Why Does the Process Keep Producing Similar Results?
The key is that each subtraction uses the same four digits in opposite orders. This creates a structured difference rather than an arbitrary new number. Sorting also means the digits have a predictable order before subtraction, which makes the outcomes much more limited than all possible four-digit numbers.
The first arrangement narrows the possibilities
Suppose the digits, from largest to smallest, are a, b, c, and d. The descending arrangement is 1000a + 100b + 10c + d. The ascending arrangement is 1000d + 100c + 10b + a. Subtracting gives:
999(a − d) + 90(b − c)
This expression shows that the result depends on two digit gaps: the difference between the largest and smallest digits, and the difference between the middle two. It does not depend on every digit independently. Because the digits range only from 0 to 9, these gaps have limited values, so the first subtraction can produce only a restricted set of results.
This formula is a useful way to understand why the routine has a pattern. It does not, by itself, show every later step, because the result must still be rearranged and subtracted again. But it explains why the operation compresses many different starting numbers into a much smaller collection of possible outcomes.
Repeated subtraction funnels results toward a fixed point
A fixed point is a value that an operation leaves unchanged. For this routine, 6174 is a fixed point because its descending and ascending arrangements always differ by 6174. The repeated operation moves eligible four-digit starting values into a chain that eventually arrives at this point.
The route is not identical for every starting number. Some numbers reach 6174 quickly, while others take more steps. The important shared feature is that, for every eligible four-digit starting number, the process reaches 6174 in no more than seven repetitions. Once there, it loops at 6174 rather than moving on.
Mathematically, the four-digit restriction makes the process finite: there are only a limited number of possible four-digit results to consider. The sorting-and-subtraction rule can therefore be checked across the possible cases. The result of that analysis is that all permitted starting values lead to 6174, while numbers with four identical digits produce a separate outcome, discussed below.
How the Digits of 6174 Explain Its Stability
The digits of 6174, arranged from greatest to least, give 7641. Arranged from least to greatest, they give 1467. Their difference is:
7641 − 1467 = 6174
That equality explains why the process stops changing once it reaches 6174. The number is not merely close to an endpoint; it reproduces itself exactly under the rule. In mathematical language, it is a fixed point of the four-digit Kaprekar operation.
The routine also has a repeating cycle for numbers that reach this fixed point: the next value is 6174 again, then 6174 again. This is sometimes called a one-number cycle. It is different from a longer cycle in which several distinct numbers would repeat in sequence.
Why Leading Zeroes Matter
After subtraction, a result may contain fewer than four visible digits. For instance, choose 2111. The descending arrangement is 2111, and the ascending arrangement is 1112. Their difference is 0999, not a three-digit value treated without its place in the four-digit routine.
Now arrange 0999 in descending order as 9990 and ascending order as 0999. Subtracting gives 9990 − 0999 = 8991. Keeping the zero makes the rule consistent: every result is handled as a four-place number, even when its first digit is zero.
In everyday writing, people often omit leading zeroes, so 0999 may simply be written as 999. For the Kaprekar routine, it helps to remember that the zero is still one of the four digits. Omitting it while arranging the next step can change the calculation.
Which Starting Numbers Reach 6174?
Every four-digit number with at least two distinct digits reaches 6174 when the routine is applied correctly. The starting number may have leading zeroes in its four-place representation, so the rule also covers values such as 0007, provided the four digits are not all the same.
Numbers with all four digits identical are the exception. For example, 7777 arranged in either order is still 7777, so the subtraction gives 0000. Repeating the process with 0000 continues to give 0000. The same happens with 1111 or 5555.
This exception is necessary because the two arrangements of an all-identical-digit number are equal. There is no difference for the routine to turn into another value. By contrast, any starting number with at least two different digits has a nonzero difference at the first subtraction and eventually joins the path to 6174.
A Second Example: Starting with 1000
Different starting points can take different routes. With 1000, the descending arrangement is 1000 and the ascending arrangement is 0001. The first subtraction gives 0999. Continuing with four places:
9990 − 0999 = 8991
9981 − 1899 = 8082
8820 − 0288 = 8532
8532 − 2358 = 6174
This example illustrates two features at once: leading zeroes must be retained during the arrangement, and a starting number can pass through several intermediate values before reaching the fixed point. Each step is mechanical, but the sequence can look surprising because the digits are repeatedly reordered.
Is 6174 the Only Kaprekar Constant?
No. Related routines can be defined for numbers with different numbers of digits, and their behavior can differ. The familiar value 6174 belongs specifically to the standard routine for four-digit numbers in base ten. Changing the number of digits or the number system changes the possible arrangements and results.
It is also important to distinguish 6174 from a general rule about all numbers. The result depends on using four decimal digits, sorting them in both directions, subtracting the smaller arrangement from the larger, and retaining leading zeroes. If one of these conditions changes, the same conclusion does not automatically apply.
Why Is the Pattern Interesting?
The routine is a compact example of how repetition can reveal structure. A starting number may seem to offer many possible outcomes, but the sorting step organizes its digits and the subtraction step forces the result into a narrower form. Repeating those operations makes the eventual destination easier to see.
It is also a practical way to explore mathematical ideas without advanced equipment or specialist knowledge. Readers can test examples by hand, check the arithmetic, and notice how different starts converge. The deeper explanation comes from analyzing the possible digit arrangements and the finite set of results, rather than from a special property of one starting number.
For accuracy, the routine should be treated as a precise process, not as a trick that works regardless of the rules. Use exactly four places, sort the same digits in opposite orders, subtract in the larger-minus-smaller direction, and repeat. Under those conditions, every four-digit starting value with nonidentical digits reaches 6174 within at most seven steps.
Conclusion
Repeatedly rearranging and subtracting four digits leads to 6174 because the operation restricts the possible results and funnels eligible starting numbers toward a fixed point. At 6174, the descending arrangement 7641 minus the ascending arrangement 1467 gives 6174 again. The rule applies to four-place decimal numbers with at least two different digits; identical-digit numbers instead reach 0000.

