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.

A370254 a(0) = 1, a(n) = result of eliminating the digit 7 from the sum of all previous terms for n>=1.

Original entry on oeis.org

1, 1, 2, 4, 8, 16, 32, 64, 128, 256, 512, 1024, 2048, 4096, 8192, 16384, 3268, 36036, 202, 224, 2498, 4996, 9992, 89984, 19968, 199936, 39982, 439854, 8908, 888616, 1232, 18464, 196928, 1993856, 39812, 402524, 4430048, 8860096, 120192, 1840384, 1968068
Offset: 0

Views

Author

Sergio Pimentel, Feb 13 2024

Keywords

Examples

			a(16) = 3268 since the sum of a(0)..a(15) = 32768. Eliminating the "7" we get 3268.
		

Crossrefs

Programs

  • Maple
    a:= proc(n) option remember; `if`(n=0, 1, (l-> add(l[i]*10^(i-1),
          i=1..nops(l)))(subs(7=NULL, convert(s(n-1), base, 10))))
        end:
    s:= proc(n) option remember; `if`(n<0, 0, s(n-1)+a(n)) end:
    seq(a(n), n=0..40);  # Alois P. Heinz, Feb 15 2024
  • Mathematica
    Module[{nmax=50, s=1, a}, NestList[(s+=(a=FromDigits[DeleteCases[IntegerDigits[s], 7]]); a) &, s, nmax]] (* Paolo Xausa, Feb 19 2024 *)
  • PARI
    lista(nn) = my(va = vector(nn)); va[1] = 1; for (n=2, nn, va[n] = sum(k=1, n-1, va[k]); my(d=digits(va[n])); if (vecsearch(Set(d), 7), my(list = List()); for (i=1, #d, if (d[i] !=7, listput(list, d[i]));); va[n] = fromdigits(Vec(list)););); va; \\ Michel Marcus, Feb 13 2024

Formula

a(n) = A004182(Sum_{i=0..n-1} a(i)) for n >= 1, a(0) = 1.
a(n) = A011782(n) for n <= 15.