OFFSET
0,3
LINKS
Reinhard Zumkeller, Table of n, a(n) for n = 0..400
Peter Luschny, An old operation on sequences: the Seidel transform
J. Millar, N. J. A. Sloane and N. E. Young, A new operation on sequences: the Boustrophedon transform, J. Combin. Theory, 17A 44-54 1996 (Abstract, pdf, ps).
Wikipedia, Boustrophedon transform
FORMULA
a(n) = Sum{k, k>=0} binomial(n, 2k+1)*A000111(n-2k-1). - Philippe Deléham, Aug 28 2005
a(n) = sum(A109449(n,k) * (n mod 2). - Reinhard Zumkeller, Nov 03 2013
MATHEMATICA
With[{nn=30}, CoefficientList[Series[(Sec[x]+Tan[x])Sinh[x], {x, 0, nn}], x] Range[ 0, nn]!] (* Harvey P. Dale, Feb 16 2013 *)
PROG
(Sage) # Generalized algorithm of L. Seidel (1877)
def A062161_list(n) :
R = []; A = {-1:0, 0:0}
k = 0; e = 1
for i in range(n) :
Am = 1 if e == -1 else 0
A[k + e] = 0
e = -e
for j in (0..i) :
Am += A[k]
A[k] = Am
k += e
# print [A[z] for z in (-i//2..i//2)]
R.append(A[e*i//2])
return R
A062161_list(10) # Peter Luschny, Jun 02 2012
(Haskell)
a062161 n = sum $ zipWith (*) (a109449_row n) $ cycle [0, 1]
-- Reinhard Zumkeller, Nov 03 2013
(Python)
from itertools import accumulate, islice
def A062161_gen(): # generator of terms
blist, m = tuple(), 1
while True:
yield (blist := tuple(accumulate(reversed(blist), initial=(m := 1-m))))[-1]
CROSSREFS
KEYWORD
nonn,easy
AUTHOR
Frank Ellermann, Jun 10 2001
STATUS
approved