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.

A033860 Sort-then-add sequence: a(n+1) = a(n) + sort(a(n)).

Original entry on oeis.org

1, 2, 4, 8, 16, 32, 55, 110, 121, 233, 466, 932, 1171, 2288, 4576, 9143, 10492, 11741, 22888, 45776, 91453, 104912, 116161, 227327, 449704, 494183, 628672, 855350, 890908, 899807, 978706, 1046495, 1191064, 1302533, 1425868, 2671556, 3927223, 6150602, 6163168
Offset: 1

Views

Author

Keywords

Examples

			After 9143 the next term is 9143 + 1349 = 10492.
		

Crossrefs

Programs

  • Haskell
    a033860 n = a033860_list !! (n-1)
    a033860_list = iterate a070196 1
    -- Reinhard Zumkeller, Apr 03 2015
    
  • Maple
    a:= proc(n) option remember; `if`(n=1, 1, (t->
          t+parse(cat(sort(convert(t, base, 10))[])))(a(n-1)))
        end:
    seq(a(n), n=1..40);  # Alois P. Heinz, Jan 15 2024
  • Mathematica
    NestList[#+FromDigits[Sort[IntegerDigits[#]]]&,1,40] (* Harvey P. Dale, Jul 24 2016 *)
  • Python
    from itertools import islice
    def agen(an=1): # generator of terms
        while True: yield an; an = an + int("".join(sorted(str(an))))
    print(list(islice(agen(), 100))) # Michael S. Branicky, Jan 15 2024

Formula

a(n+1) = A070196(a(n)). - Reinhard Zumkeller, Apr 03 2015