login
A370748
a(0)=1; a(n) = sum of all previous terms, eliminating repeated digits (starting from the left).
3
1, 1, 2, 4, 8, 16, 32, 64, 128, 256, 512, 1024, 2048, 4096, 8192, 16384, 32768, 653, 6189, 7238, 7961, 875, 8452, 9604, 10658, 176, 17342, 13468, 14852, 16304, 179308, 35861, 3947, 39842, 43826, 48209, 5301, 53602, 589204, 17840, 196248, 139246, 153742, 16854
OFFSET
0,3
COMMENTS
Duplicate digits are eliminated as in A137564.
No term can be greater than 9876543210.
a(260390084) = 9876543210. - Michael S. Branicky, Apr 09 2024
LINKS
EXAMPLE
a(17) = 653 since the sum of a(0) through a(16) is 65536, and eliminating repeated digits gives a(17) = A137564(65536) = 653.
MATHEMATICA
seq={1}; Do[s=Total[seq]; AppendTo[seq, FromDigits[DeleteDuplicates[IntegerDigits[s]]]], 43]; seq (* James C. McMahon, Apr 09 2024 *)
PROG
(PARI) f(n) = my(d=digits(n)); fromdigits(vecextract(d, vecsort(vecsort(d, , 9)))) \\ A137564
lista(nn) = my(va=vector(nn)); va[1] = 1; for (n=2, nn, va[n] = f(sum(j=1, n-1, va[j])); ); va; \\ Michel Marcus, Mar 08 2024
(Python)
from itertools import islice
def A137564(n):
seen, out, s = set(), "", str(n)
for d in s:
if d not in seen: out += d; seen.add(d)
return int(out)
def A370748gen(): # generator of terms
an, s = 1, 0
while True:
yield an
s += an
an = A137564(s)
print(list(islice(A370748gen(), 45))) # Michael S. Branicky, Apr 09 2024
CROSSREFS
Cf. A371863 (records), A371864 (indices of records).
Sequence in context: A220493 A320487 A323830 * A118655 A335891 A249169
KEYWORD
base,nonn
AUTHOR
Sergio Pimentel, Mar 07 2024
STATUS
approved