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.

A158856 Triangle T(n, k) = coefficients of p(n, x), where p(n, x) = (1 - x^(2+floor((n-1)/2)))*(1 + (-1)^floor(n/2)*x^(1+floor(n/2))), read by rows.

Original entry on oeis.org

1, 1, 1, 1, 0, -1, 1, 0, 0, -1, 1, 0, 1, 0, 1, 1, 0, 1, 1, 0, 1, 1, 0, 1, 0, -1, 0, -1, 1, 0, 1, 0, 0, -1, 0, -1, 1, 0, 1, 0, 1, 0, 1, 0, 1, 1, 0, 1, 0, 1, 1, 0, 1, 0, 1, 1, 0, 1, 0, 1, 0, -1, 0, -1, 0, -1
Offset: 0

Views

Author

Roger L. Bagula, Mar 28 2009

Keywords

Examples

			Triangle begins as:
  1;
  1,  1;
  1,  0, -1;
  1,  0,  0, -1;
  1,  0,  1,  0,  1;
  1,  0,  1,  1,  0,  1;
  1,  0,  1,  0, -1,  0, -1;
  1,  0,  1,  0,  0, -1,  0, -1;
  1,  0,  1,  0,  1,  0,  1,  0,  1;
  1,  0,  1,  0,  1,  1,  0,  1,  0,  1;
  1,  0,  1,  0,  1,  0, -1,  0, -1,  0, -1;
		

Crossrefs

Programs

  • Mathematica
    p[x_, n_]= (1-x^(2+Floor[(n-1)/2]))*(1+(-1)^Floor[n/2]*x^(1+Floor[n/2]))/(1 - x^2);
    Table[CoefficientList[p[x, n], x], {n,0,12}]//Flatten (* modified by G. C. Greubel, Mar 07 2022 *)
  • Sage
    def p(n,x): return (1-x^(2+((n-1)//2)))*(1+(-1)^(n//2)*x^(1+(n//2)))/(1-x^2)
    def A158856(n,k): return ( p(n,x) ).series(x, n+1).list()[k]
    flatten([[A158856(n,k) for k in (0..n)] for n in (0..12)]) # G. C. Greubel, Mar 07 2022

Formula

T(n, k) = coefficients of p(n, x), where p(n, x) = (Sum_{j=0..1+floor((n-1)/2)} x^j)*(Sum_{i=0..floor(n/2)} (-x)^i) and p(0, x) = 1.
From G. C. Greubel, Mar 07 2022: (Start)
T(n, k) = coefficients of p(n, x), where p(n, x) = (1 - x^(2+floor((n-1)/2)))*(1 + (-1)^floor(n/2)*x^(1+floor(n/2))).
Sum_{k=0..n} T(n, k) = floor((n+3)/2)*( (1 + floor(n/2)) mod 2 ).
Sum_{k=0..n} abs(T(n, k)) = A004524(n+3).
T(2*n, n) = (1 + (-1)^n)/2.
T(2*n+1, n) = (1 + (-1)^n)/2.
Sum_{k=0..floor(n/2)} T(n, k) = floor((n+4)/4).
T(n, k) = abs(A154957(n,k)). (End)

Extensions

Edited by G. C. Greubel, Mar 07 2022