cp's OEIS Frontend

This is a front-end for the Online Encyclopedia of Integer Sequences, made by Christian Perfect. The idea is to provide OEIS entries in non-ancient HTML, and then to think about how they're presented visually. The source code is on GitHub.

A062161 Boustrophedon transform of n mod 2.

Original entry on oeis.org

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

Views

Author

Frank Ellermann, Jun 10 2001

Keywords

Crossrefs

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(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_{k=0..n} A109449(n,k) * (k mod 2). - Reinhard Zumkeller, Nov 03 2013 [corrected by Jason Yuen, Jan 07 2025]