login
A151951
a(1) = 1113; thereafter a(n) = (a(n-1) with digits sorted into descending order) - (a(n-1) with digits sorted into ascending order) (see the Kaprekar map, A151949).
2
1113, 1998, 8082, 8532, 6174, 6174, 6174, 6174, 6174, 6174, 6174, 6174, 6174, 6174, 6174, 6174, 6174, 6174, 6174, 6174, 6174, 6174, 6174, 6174, 6174, 6174, 6174, 6174, 6174, 6174, 6174, 6174, 6174, 6174, 6174, 6174, 6174, 6174, 6174, 6174
OFFSET
1,1
MATHEMATICA
NestList[FromDigits[Reverse[Sort[IntegerDigits[#]]]]-FromDigits[Sort[ IntegerDigits[ #]]]&, 1113, 40] (* or *) PadRight[{1113, 1998, 8082, 8532}, 40, {6174}] (* Harvey P. Dale, May 10 2021 *)
CROSSREFS
KEYWORD
nonn,base
AUTHOR
N. J. A. Sloane, Aug 18 2009
STATUS
approved