OFFSET
0,2
COMMENTS
Boustrophedon transform of A000244 (powers of 3).
MATHEMATICA
nmax = 22; CoefficientList[Series[Exp[3 x] (Sec[x] + Tan[x]), {x, 0, nmax}], x] Range[0, nmax]!
t[n_, 0] := 3^n; t[n_, k_] := t[n, k] = t[n, k - 1] + t[n - 1, n - k]; a[n_] := t[n, n]; Array[a, 23, 0]
PROG
(Python)
from itertools import accumulate, islice
def A307878_gen(): # generator of terms
blist, m = tuple(), 1
yield from blist
while True:
yield (blist := tuple(accumulate(reversed(blist), initial=m)))[-1]
m *= 3
CROSSREFS
KEYWORD
nonn
AUTHOR
Ilya Gutkovskiy, Jun 04 2019
STATUS
approved