Kaprekar Routine

​
number
156086
display
array plot
list plot
numbers
5
10
15
20
25
200000
400000
600000
800000
1e+6
Take a k-digit number, n, and rearrange its digits in descending order. Call this number B. Now arrange the digits in ascending order and call that number b. Compute
B-b
and repeat the operation. This algorithm, known as the Kaprekar routine, always becomes cyclic. It was discovered in 1949 by D. R. Kaprekar for 4-digit numbers.

External Links

Kaprekar Routine (Wolfram MathWorld)

Permanent Citation

Rob Morris
​
​"Kaprekar Routine"​
​http://demonstrations.wolfram.com/KaprekarRoutine/​
​Wolfram Demonstrations Project​
​Published: September 28, 2007