A033862 Sorted number reached from starter n in Sort-then-add sequence, or -1 if never reaches sorted number.
1, 2, 3, 4, 5, 6, 7, 8, 9, 11, 11, 12, 13, 14, 15, 16, 17, 18, 19, 22, 33, 22, 23, 24, 25, 26, 27, 28, 29, 33, 44, 55, 33, 34, 35, 36, 37, 38, 39, 44, 55, 66, 77, 44, 45, 46, 47, 48, 49, 55, 66, 77, 88, 99, 55, 56, 57, 58, 59, 66, 77, 88, 99, 233, 233, 66, 67, 68, 69, 77, 88
Offset: 1
Links
- Michael S. Branicky, Table of n, a(n) for n = 1..315
- Eric Weisstein's World of Mathematics, Sort-then-Add Sequence.
Programs
-
Python
from itertools import islice def a(n): while n != (s:=int("".join(sorted(str(n))))): n += s return s print([a(n) for n in range(1, 72)]) # Michael S. Branicky, Jan 15 2024
Comments