A370748 a(0)=1; a(n) = sum of all previous terms, eliminating repeated digits (starting from the left).
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
Examples
a(17) = 653 since the sum of a(0) through a(16) is 65536, and eliminating repeated digits gives a(17) = A137564(65536) = 653.
Links
- Alois P. Heinz, Table of n, a(n) for n = 0..20000
Programs
-
Mathematica
seq={1};Do[s=Total[seq];AppendTo[seq,FromDigits[DeleteDuplicates[IntegerDigits[s]]]],43];seq (* James C. McMahon, Apr 09 2024 *)
-
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
Comments