(Translated by https://www.hiragana.jp/)
A033860 - OEIS
login
A033860
Sort-then-add sequence: a(n+1) = a(n) + sort(a(n)).
19
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,2
LINKS
FORMULA
a(n+1) = A070196(a(n)). - Reinhard Zumkeller, Apr 03 2015
EXAMPLE
After 9143 the next term is 9143 + 1349 = 10492.
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 *)
PROG
(Haskell)
a033860 n = a033860_list !! (n-1)
a033860_list = iterate a070196 1
-- Reinhard Zumkeller, Apr 03 2015
(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
CROSSREFS
Sequence in context: A175951 A072207 A176718 * A374731 A374733 A231388
KEYWORD
nonn,base
STATUS
approved