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.

A158854 Triangle T(n,k) read by rows: coefficient [x^k] of the polynomial (1-x)^(1+floor(n/2))* (1+x)^floor((n-1)/2) in row n, column k.

Original entry on oeis.org

1, 1, -1, 1, -2, 1, 1, -1, -1, 1, 1, -2, 0, 2, -1, 1, -1, -2, 2, 1, -1, 1, -2, -1, 4, -1, -2, 1, 1, -1, -3, 3, 3, -3, -1, 1, 1, -2, -2, 6, 0, -6, 2, 2, -1, 1, -1, -4, 4, 6, -6, -4, 4, 1, -1, 1, -2, -3, 8, 2, -12, 2, 8, -3, -2, 1
Offset: 0

Views

Author

Roger L. Bagula, Mar 28 2009

Keywords

Comments

Row sums are zero except for n=0.

Examples

			1;
1, -1;
1, -2, 1;
1, -1, -1, 1;
1, -2, 0, 2, -1;
1, -1, -2, 2, 1, -1;
1, -2, -1, 4, -1, -2, 1;
1, -1, -3, 3, 3, -3, -1, 1;
1, -2, -2, 6, 0, -6, 2, 2, -1;
1, -1, -4, 4, 6, -6, -4, 4, 1, -1;
1, -2, -3, 8, 2, -12, 2, 8, -3, -2, 1;
		

Crossrefs

Programs

  • Maple
    A158854 := proc(n,k)
        (1-x)^(1+floor(n/2))*(1+x)^floor((n-1)/2) ;
        coeftayl(%,x=0,k) ;
    end proc: # R. J. Mathar, Apr 08 2013
  • Mathematica
    Clear[p, x, n, m, a];
    p[x_, n_] = If[n == 0, 1, (1 - x)^(Floor[(n)/ 2] + 1)(1 + x)^(Floor[(n - 1)/2])];
    Table[ExpandAll[p[x, n]], {n, 0, 10}];
    Table[CoefficientList[ExpandAll[p[x, n]], x], {n, 0, 10}];
    Flatten[%]

Formula

T(n,k) = T(n-2,k) - T(n-2,k-2), T(0,0) = T(1,0) = T(2,0) = T(2,2) = 1, T(1,1)=-1, T(2,1)=-2, T(n,k) = 0 if k<0 or if k>n. - Philippe Deléham, Oct 25 2013