A062161 Boustrophedon transform of n mod 2.
0, 1, 2, 4, 12, 36, 142, 624, 3192, 18256, 116282, 814144, 6219972, 51475776, 458790022, 4381112064, 44625674352, 482962852096, 5534347077362, 66942218896384, 852334810990332, 11394877025289216, 159592488559874302, 2336793875186479104, 35703580441464231912
Offset: 0
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.
- Index entries for sequences related to boustrophedon transform.
Programs
-
Haskell
a062161 n = sum $ zipWith (*) (a109449_row n) $ cycle [0,1] -- 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 *)
-
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] A062161_list = list(islice(A062161_gen(),40)) # Chai Wah Wu, Jun 12 2022
-
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
Formula
a(n) = Sum{k, k>=0} binomial(n, 2k+1)*A000111(n-2k-1). - Philippe Deléham, Aug 28 2005
a(n) = Sum_{k=0..n} A109449(n,k) * (k mod 2). - Reinhard Zumkeller, Nov 03 2013 [corrected by Jason Yuen, Jan 07 2025]