A033863 Least number of Sort-then-add persistence n.
1, 10, 65, 64, 175, 98, 240, 325, 302, 387, 198, 180, 550, 806, 855, 486, 351, 315, 944, 2428, 2204, 3172, 1793, 1316, 937, 2775, 1815, 1461, 2541, 9378, 13327, 9638, 8149, 6581, 46965, 23487, 12198, 10599, 10920, 52345, 48788, 180666, 174870, 291119, 155563, 915443
Offset: 0
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.
Programs
-
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
Extensions
a(44)-a(45) from Sean A. Irvine, Jul 26 2020