This is a front-end for the Online Encyclopedia of Integer Sequences, made by Christian Perfect. The idea is to provide OEIS entries in non-ancient HTML, and then to think about how they're presented visually. The source code is on GitHub.
%I A151951 #8 May 10 2021 18:30:49 %S A151951 1113,1998,8082,8532,6174,6174,6174,6174,6174,6174,6174,6174,6174, %T A151951 6174,6174,6174,6174,6174,6174,6174,6174,6174,6174,6174,6174,6174, %U A151951 6174,6174,6174,6174,6174,6174,6174,6174,6174,6174,6174,6174,6174,6174 %N 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). %H A151951 <a href="/index/K#Kaprekar_map">Index entries for the Kaprekar map</a> %t A151951 NestList[FromDigits[Reverse[Sort[IntegerDigits[#]]]]-FromDigits[Sort[ IntegerDigits[ #]]]&,1113,40] (* or *) PadRight[{1113,1998,8082,8532},40,{6174}] (* _Harvey P. Dale_, May 10 2021 *) %Y A151951 Cf. A099009, A151947, A151949, A151950, A069746. %K A151951 nonn,base %O A151951 1,1 %A A151951 _N. J. A. Sloane_, Aug 18 2009