cp's OEIS Frontend

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.

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).

Original entry on oeis.org

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

Views

Author

N. J. A. Sloane, Aug 18 2009

Keywords

Crossrefs

Programs

  • 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 *)