Math Tools Math Tools

Why 6174 Is Called the Kaprekar Constant

Why 6174 Is Called the Kaprekar Constant

By Math Tools ·

Why 6174 Is Called the Kaprekar Constant

Try this with the year 2026:

  1. Arrange its digits from largest to smallest: 6220
  2. Arrange them from smallest to largest: 0226
  3. Subtract: 6220 − 0226 = 5994

Now repeat with 5994, and keep going:

9954 − 4599 = 5355
5553 − 3555 = 1998
9981 − 1899 = 8082
8820 − 0288 = 8532
8532 − 2358 = 6174
7641 − 1467 = 6174

You've landed on 6174, and it's stuck there, because 7641 − 1467 gives 6174 again. Try almost any four-digit number and you'll arrive at the same place in seven steps or fewer.


Almost Every Starting Point Leads to One Number

We expect a process fed with thousands of different numbers to produce thousands of different results. This one doesn't. Out of the 9,000 four-digit numbers, every one whose digits aren't all identical flows to 6174.

It's like water running downhill into a single valley. Mathematicians call 6174 a fixed point, and in this case an attracting one.


The Rules

The process is called Kaprekar's routine:

  1. Take a four-digit number with at least two different digits. Leading zeros count: treat 21 as 0021.
  2. Form the largest number from its digits and the smallest.
  3. Subtract the smaller from the larger.
  4. Repeat with the result, keeping leading zeros.

Why at least two different digits? A repdigit like 3333 gives 3333 − 3333 = 0, and gets stuck at 0.

Here's the 2026 example as a table:

Step Largest Smallest Difference
1 6220 0226 5994
2 9954 4599 5355
3 5553 3555 1998
4 9981 1899 8082
5 8820 0288 8532
6 8532 2358 6174

Six steps. Try another: 3524 → 5432 − 2345 = 3087 → 8730 − 0378 = 8352 → 8532 − 2358 = 6174, in three steps. Practice the subtraction with the subtraction tables.


Why 6174 Is a Fixed Point

The digits of 6174 are 7, 6, 4 and 1:

7641 − 1467 = 6174

Subtracting its smallest arrangement from its largest gives back itself. It's the only four-digit number, other than the degenerate 0000, with this property. Look up 6174 to see more of its properties.


Why Everything Gets There So Fast

Here's the key insight: the result of each step depends only on the differences between digits, not the digits themselves.

If the sorted digits are a ≥ b ≥ c ≥ d, then:

(1000a + 100b + 10c + d) − (1000d + 100c + 10b + a)
= 999(a − d) + 90(b − c)

So the result depends only on two numbers: a − d (between 1 and 9) and b − c (between 0 and a − d). That's at most 54 possible outcomes after the very first step, no matter which of the 9,000 numbers you started with.

With so few possibilities, a computer (or a patient person) can check every one of them, and they all reach 6174 within seven steps total. The routine shrinks thousands of possibilities to dozens, then to one.


An Insider Reference: D. R. Kaprekar

Dattatreya Ramchandra Kaprekar (1905–1986) was a schoolteacher in Devlali, a small town near Nashik in India. He had no formal postgraduate training in mathematics, yet he spent his life discovering properties of numbers, publishing in small journals and pamphlets.

He discovered the 6174 routine in 1949 and presented it at a mathematics conference in Madras. Established mathematicians initially dismissed his work as trivial recreation. Recognition came later, particularly after Martin Gardner wrote about Kaprekar's discoveries in his "Mathematical Games" column in Scientific American in 1975.

Today, Kaprekar is also remembered for Kaprekar numbers. For example, 45² = 2025, and 20 + 25 = 45. Check 2025 to see it.


Other Digit Lengths

  • Three digits: everything goes to 495 within 6 steps. Try 352: 532 − 235 = 297 → 972 − 279 = 693 → 963 − 369 = 594 → 954 − 459 = 495. See 495.
  • Two digits: no fixed point. Numbers fall into the loop 9 → 81 → 63 → 27 → 45 → 9.
  • Five digits and more: multiple cycles appear, and there's no single universal constant. Six digits have two fixed points: 549945 and 631764.

Four digits is special: one clean, universal destination.


Two Concepts Worth Knowing

Fixed Point

A fixed point of a function f is a value x with f(x) = x. 6174 is a fixed point of Kaprekar's routine. Fixed points are central in everything from calculus to economics.

Divisibility by 9

Every Kaprekar difference is a multiple of 9, since 999 and 90 are both divisible by 9. Indeed, 6 + 1 + 7 + 4 = 18. That's another reason the number of possible results is so small.


Quick Answer: Why Is 6174 Called Kaprekar's Constant?

6174 is called Kaprekar's constant because applying Kaprekar's routine (arranging a four-digit number's digits in descending and ascending order and subtracting) to any four-digit number with at least two different digits reaches 6174 within seven steps. At 6174, the routine returns 7641 − 1467 = 6174, so it stays there.


Try Them Yourself

Try the last four digits of your phone number. Count the steps to 6174. Can you find a starting number that takes the full seven?