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.

A000667 Boustrophedon transform of all-1's sequence.

Original entry on oeis.org

1, 2, 4, 9, 24, 77, 294, 1309, 6664, 38177, 243034, 1701909, 13001604, 107601977, 959021574, 9157981309, 93282431344, 1009552482977, 11568619292914, 139931423833509, 1781662223749884, 23819069385695177, 333601191667149054, 4884673638115922509
Offset: 0

Views

Author

Keywords

Comments

Fill in a triangle, like Pascal's triangle, beginning each row with a 1 and filling in rows alternately right to left and left to right.
Row sums of triangle A109449. - Reinhard Zumkeller, Nov 04 2013

Examples

			...............1..............
............1..->..2..........
.........4..<-.3...<-..1......
......1..->.5..->..8...->..9..
		

Crossrefs

Absolute value of pairwise sums of A009337.
Column k=1 of A292975.

Programs

  • Haskell
    a000667 n = if x == 1 then last xs else x
                where xs@(x:_) = a227862_row n
    -- Reinhard Zumkeller, Nov 01 2013
    
  • Mathematica
    With[{nn=30},CoefficientList[Series[Exp[x](Tan[x]+Sec[x]),{x,0,nn}], x]Range[0,nn]!] (* Harvey P. Dale, Nov 28 2011 *)
    t[, 0] = 1; t[n, k_] := t[n, k] = t[n, k-1] + t[n-1, n-k];
    a[n_] := t[n, n];
    Array[a, 30, 0] (* Jean-François Alcover, Feb 12 2016 *)
  • PARI
    x='x+O('x^33); Vec(serlaplace( exp(x)*(tan(x) + 1/cos(x)) ) ) \\ Joerg Arndt, Jul 30 2016
    
  • Python
    from itertools import islice, accumulate
    def A000667_gen(): # generator of terms
        blist = tuple()
        while True:
            yield (blist := tuple(accumulate(reversed(blist),initial=1)))[-1]
    A000667_list = list(islice(A000667_gen(),20)) # Chai Wah Wu, Jun 11 2022
  • Sage
    # Algorithm of L. Seidel (1877)
    def A000667_list(n) :
        R = []; A = {-1:0, 0:0}
        k = 0; e = 1
        for i in range(n) :
            Am = 1
            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
    A000667_list(10)  # Peter Luschny, Jun 02 2012
    

Formula

E.g.f.: exp(x) * (tan(x) + sec(x)).
Limit_{n->infinity} 2*n*a(n-1)/a(n) = Pi; lim_{n->infinity} a(n)*a(n-2)/a(n-1)^2 = 1 + 1/(n-1). - Gerald McGarvey, Aug 13 2004
a(n) = Sum_{k=0..n} binomial(n, k)*A000111(n-k). a(2*n) = A000795(n) + A009747(n), a(2*n+1) = A002084(n) + A003719(n). - Philippe Deléham, Aug 28 2005
a(n) = A227862(n, n * (n mod 2)). - Reinhard Zumkeller, Nov 01 2013
G.f.: E(0)*x/(1-x)/(1-2*x) + 1/(1-x), where E(k) = 1 - x^2*(k + 1)*(k + 2)/(x^2*(k + 1)*(k + 2) - 2*(x*(k + 2) - 1)*(x*(k + 3) - 1)/E(k+1) ); (continued fraction). - Sergei N. Gladkovskii, Jan 16 2014
a(n) ~ n! * exp(Pi/2) * 2^(n+2) / Pi^(n+1). - Vaclav Kotesovec, Jun 12 2015