cp's OEIS Frontend

This is a front-end for the Online Encyclopedia of Integer Sequences, made by Christian Perfect. The idea is to provide OEIS entries in non-ancient HTML, and then to think about how they're presented visually. The source code is on GitHub.

A370748 a(0)=1; a(n) = sum of all previous terms, eliminating repeated digits (starting from the left).

Original entry on oeis.org

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

Views

Author

Sergio Pimentel, Mar 07 2024

Keywords

Comments

Duplicate digits are eliminated as in A137564.
No term can be greater than 9876543210.
a(260390084) = 9876543210. - Michael S. Branicky, Apr 09 2024

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.
		

Crossrefs

Cf. A371863 (records), A371864 (indices of records).

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