login
The OEIS is supported by the many generous donors to the OEIS Foundation.

 


A062161
Boustrophedon transform of n mod 2.
6
0, 1, 2, 4, 12, 36, 142, 624, 3192, 18256, 116282, 814144, 6219972, 51475776, 458790022, 4381112064, 44625674352, 482962852096, 5534347077362, 66942218896384, 852334810990332, 11394877025289216
OFFSET
0,3
LINKS
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).
FORMULA
a(2n) = A009747(n), a(2n+1) = A002084(n).
E.g.f.: (sec(x)+tan(x))sinh(x); a(n)=(A000667(n)-A062162(n))/2. - Paul Barry, Jan 21 2005
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]
A062161_list = list(islice(A062161_gen(), 40)) # Chai Wah Wu, Jun 12 2022
CROSSREFS
Sequence in context: A086647 A268600 A187119 * A195733 A046993 A282165
KEYWORD
nonn,easy
AUTHOR
Frank Ellermann, Jun 10 2001
STATUS
approved

Lookup | Welcome | Wiki | Register | Music | Plot 2 | Demos | Index | Browse | WebCam
Contribute new seq. or comment | Format | Style Sheet | Transforms | Superseeker | Recents
The OEIS Community | Maintained by The OEIS Foundation Inc.

License Agreements, Terms of Use, Privacy Policy. .

Last modified September 22 13:01 EDT 2024. Contains 376114 sequences. (Running on oeis4.)