Why 6174 Is Kaprekar's Constant
The Kaprekar routine is a digit-sorting map on a finite set, so iteration must terminate; 6174 is the unique attractor of that map, reached in at most a few steps.
A complete interactive classroom, not just a preview.
Start when you are ready to enter this Stage's 9 scenes and explore, respond, and learn as you go.
Why does repeatedly subtracting the ascending and descending arrangements of a 4-digit number always produce 6174?
Pick any four-digit number whose digits aren't all the same. Sort its digits descending, subtract the ascending version, and repeat. You always land on 6174.
It feels almost magical that a single number pulls in every starting point — and mysterious that the constant appears for 4-digit numbers but not for other lengths.
Step-by-step descent traces from multiple starting numbers, a side-by-side comparison with a 3-digit attempt, and a visual map of how values collapse into 6174.
6174 is the unique fixed point of the Kaprekar digit-sorting map on 4-digit numbers; every valid start descends to it in at most 7 steps.
Because 6174 looks 'balanced' (digits 6,1,7,4 are all different and sum to 18), some special arithmetic property must keep pushing numbers toward it.
- Kaprekar's constant for other digit lengths (e.g., 495 for 3 digits, 6174 for 4 digits)
- Historical biography of D. R. Kaprekar
- Cryptographic or number-theoretic generalizations of Kaprekar routines
- Base systems other than base 10
- 01Meet the Kaprekar RoutineslideQuestion
Introduce the descending-minus-ascending procedure and show a single worked example so the learner sees what 'repeating the routine' means.
- Take a 4-digit number with at least two different digits.
- Form the largest and smallest numbers by sorting its digits.
- Subtract the smaller from the larger and repeat.
- 02Try It Yourself: Where Will It Land?interactivePrediction
Let the learner enter a 4-digit number and watch the routine iterate, so they commit to a guess before the structural argument appears.
- Type any 4-digit number with at least two distinct digits.
- Predict whether it ends at 6174, at 0, or at a different value.
- Run the iteration and observe the actual landing point.
- 03Many Starts, Same DestinationslideEvidence
Present descent traces from several different starting numbers to show empirically that they all funnel into 6174.
- Try 2111, 9830, 1000, 4994 — all are routed to 6174.
- Maximum observed descent length is 7 steps.
- Numbers with all digits identical become 0 and are excluded from the map.
- 04Map the State SpaceinteractiveEvidence
A small directed graph widget that visualizes reachable values and their transitions, so the learner can see 6174 as the unique sink.
- Each node is a 4-digit value with at least two distinct digits.
- Directed edges show the result of one Kaprekar step.
- 6174 is shown with a self-loop; no node leads to a different fixed point.
- 05Why a Sink Must Exist (Finite State Space Argument)slideExplanation
Lay out the core proof idea: finite set, deterministic step, so every orbit must terminate in a cycle — and the cycle must contain 6174.
- At most 9000 reachable 4-digit values form a finite set.
- A deterministic map on a finite set makes every orbit eventually periodic.
- 6174 is the only periodic element reachable from valid starts.
- 06From Any Start, Follow the ArrowinteractiveExplanation
A highlighter widget where the learner selects a starting node and the simulation traces its orbit forward step by step, illuminating each edge until it reaches 6174.
- Click any node to highlight its orbit.
- Watch the path collapse through small chains before reaching 6174.
- Confirm that 6174 has only a self-loop as outgoing edge.
- 07What If the Digits Were Three?quizTransfer
A single transfer question asking the learner to predict the analogous constant for 3-digit numbers based on the 4-digit mechanism just explained.
- Apply the same descent argument to 3-digit numbers.
- Identify the 3-digit Kaprekar constant by reasoning, not recall.
- 08When the Magic BreaksslideBoundary
Show that the same structure fails or changes for inputs the procedure was not designed for: uniform-digit numbers, 3-digit starts, and 5-digit starts.
- Numbers like 1111 map to 0, not 6174.
- For 3-digit starts the attracting constant is 495.
- For 5-digit starts there is no single universal attractor.
- 09The Answer: A Unique Fixed Point in a Finite WorldslideResolution
Tie the prediction, evidence, and finite-set argument together to directly answer the driving question.
- 6174 equals 7641 minus 1467, so it is a fixed point of the map.
- It is the only fixed point reachable from valid 4-digit starts.
- Every valid start descends to 6174 in at most 7 steps.
Discussion threads for a Stage aren't available yet.