Kaprekar Four-Digit Attractor
Sort four digits in opposite orders and subtract: thousands of starting numbers fall into the same 6174 attractor.
Free theory articleSort four digits in opposite orders and subtract: thousands of starting numbers fall into the same 6174 attractor.
Concept & interpretation
The Kaprekar routine for four-digit numbers is a finite dynamical system where every initial number, except those with four identical digits, eventually reaches the attractor 6174 (Kaprekar's constant). The routine involves sorting the digits of the number in descending and ascending order, and subtracting the smaller from the larger, padding with leading zeros to maintain exactly four digits.
Experiment
In the interactive module, follow these steps to see the Kaprekar routine in action:
- Select a string from the "Initial digits" control to pick a starting number.
- Select a number from the "Inspection step" control to view the subtraction at a particular iteration.
- Observe the "Current four digits" text to trace the trajectory.