OFFSET
0,3
LINKS
Alois P. Heinz, Table of n, a(n) for n = 0..16384
EXAMPLE
a(16) = 3268 since the sum of a(0)..a(15) = 32768. Eliminating the "7" we get 3268.
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 *)
PROG
(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
CROSSREFS
KEYWORD
AUTHOR
Sergio Pimentel, Feb 13 2024
STATUS
approved