The number
6174 arises in the following famous problem :
Take any 4-digit number

which uses more than one digit and find the difference

between the numbers formed by writing the digits in descending order and ascending order.
For example, starting with

yields

. Iterate this process using the difference

as the new 4-digit number. In other words,
![\begin{array}{lcl}
x_3&=&T(x_2)=7632-2367=5265 \\
x_4&=&T(x_3)=6552-2556=3996\\
x_5&=&T(x_4)=9963-3699=6264\\
x_5&=&T(x_5)=6642-2466=4176\\
x_6&=&T(x_6)=7641-1467={\mathbf 6174}\\
x_7&=&T({\mathbf 6174})={\mathbf 6174}
\end{array}
[/etx]
The <strong>Indian mathematician <span style="color: blue"> D.R. Kaprekar </span> </strong> discovered that this process leads in at most 7 steps to the number [tex] {\mathbf 6174}= \begin{array}{lcl}
x_3&=&T(x_2)=7632-2367=5265 \\
x_4&=&T(x_3)=6552-2556=3996\\
x_5&=&T(x_4)=9963-3699=6264\\
x_5&=&T(x_5)=6642-2466=4176\\
x_6&=&T(x_6)=7641-1467={\mathbf 6174}\\
x_7&=&T({\mathbf 6174})={\mathbf 6174}
\end{array}
[/etx]
The <strong>Indian mathematician <span style="color: blue"> D.R. Kaprekar </span> </strong> discovered that this process leads in at most 7 steps to the number [tex] {\mathbf 6174}=](/CBB/latexrender/pictures/cbd95cbd9f38dc0a755bc181a215f051.png)
[i ]Kaprekar's constant[/i], a fixed point of the iteration.
QUESTION:
Justify the Kaprekar's routine. Try to find generalizations of this algorithm .Remarks: 1) Regarding Kaprekar's original publications: He self-published most of his results, via a small Indian publishing company at his own expense.
2) It seems that by using Kaprekar's routine , exactly 77 four-digit numbers, namely 1000, 1011, 1101, 1110, 1111, 1112, 1121, 1211, ...
(see [13] Sloane's A069746), reach 0, while the remainder give
6174 in at most 8 iterations.
REFERENCES:[1] Deutsch D. and Goldman B. ,
Kaprekar's Constant, Math. Teacher 98,(2004) 234--242.
[2] Eldridge, K. E. and Sagong, S.
The Determination of Kaprekar Convergence and Loop Convergence of All 3-Digit Numbers, Amer. Math. Monthly 95, (1988) 105--112.
[3] Furno A.L. , J. Number Theory 13, no.2, (1981) 255--261.
[4] Hasse H. ,
Iterierter Differenzbetrag für
-stellige
-adische Zahlen,
(German, Spanish summary) Rev. Real Acad. Cienc. Exact. FÃs. Natur. Madrid 72 (1978), no. 2, 221--240.
[5] Hasse H. and Prichett G. D. ,
The determination of all four-digit Kaprekar constants, J. Reine Angew. Math. 299/300 (1978), 113--124.
[6] Kaprekar D. R. ,
An Interesting Property of the Number 6174, Scripta Math. 15,(1955) 244--245.
[7] Kiyoshi Iseki ,
Note on Kaprekar's constant, Math. Japon. 29 (1984), no. 2, 237--239.
[8] Lapenta J. F., Ludington A. L. and Prichett G. D.,
An algorithm to determine self-producing
-digit
-adic integers, J. Reine Angew. Math. 310 (1979) 100--110.
[9] Ludington Anne L.,
A bound on Kaprekar constants, J. Reine Angew. Math. 310 (1979), 196--203.
[10] Prichett G. D., Ludington A. L. and Lapenta J. F.,
The determination of all decadic Kaprekar constants, Fibonacci Quart. 19 , no. 1,(1981) 45--52.
[11] Rosen Ken,
Elementary Number Theory Book, (4-th. ed, see page 47)
[12] A. Rosenfeld, Scripta Mathematica 15 (1949), 241--246,
[13] Sloane, N. J. A.
Sequences A069746,A090429, A099009, and A099010 , in
The On-Line Encyclopedia of Integer Sequences, http://www.research.att.com/~njas/sequences/.
[14] Trigg, C. W. ,
All Three-Digit Integers Lead to..., The Math. Teacher, 67 (1974) 41-45.
[15] Young, A. L. ,
A Variation on the 2-digit Kaprekar Routine, Fibonacci Quart. 31,(1993) 138--145.
[ Perhaps of interest ,Alex]