OFFSET
0,2
LINKS
Michael S. Branicky, Table of n, a(n) for n = 0..100
Sean A. Irvine, Java program (github).
Eric Weisstein's World of Mathematics, Sort-Then-Add Sequence.
PROG
(Python)
from itertools import count, islice
def agen(LIMIT):
adict, n = dict(), 0
for k in count(1):
c, m = 0, k
while c <= LIMIT and m != (s:=int("".join(sorted(str(m))))):
m += s; c += 1
if c not in adict:
adict[c] = k
while n in adict and n <= LIMIT: yield adict[n]; n += 1
if n > LIMIT: return
print(list(agen(40))) # Michael S. Branicky, Jan 16 2024
CROSSREFS
KEYWORD
nonn,base
AUTHOR
EXTENSIONS
a(44)-a(45) from Sean A. Irvine, Jul 26 2020
STATUS
approved
