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.

A180957 Generalized Narayana triangle for (-1)^n.

Original entry on oeis.org

1, 1, 1, 1, 1, 1, 1, 0, 0, 1, 1, -2, -5, -2, 1, 1, -5, -15, -15, -5, 1, 1, -9, -30, -41, -30, -9, 1, 1, -14, -49, -77, -77, -49, -14, 1, 1, -20, -70, -112, -125, -112, -70, -20, 1, 1, -27, -90, -126, -117, -117, -126, -90, -27, 1, 1, -35, -105, -90, 45, 131, 45, -90, -105, -35, 1
Offset: 0

Views

Author

Paul Barry, Sep 28 2010

Keywords

Examples

			Triangle begins
  1;
  1,   1;
  1,   1,    1;
  1,   0,    0,    1;
  1,  -2,   -5,   -2,    1;
  1,  -5,  -15,  -15,   -5,    1;
  1,  -9,  -30,  -41,  -30,   -9,    1;
  1, -14,  -49,  -77,  -77,  -49,  -14,   1;
  1, -20,  -70, -112, -125, -112,  -70, -20,    1;
  1, -27,  -90, -126, -117, -117, -126, -90,  -27,   1;
  1, -35, -105,  -90,   45,  131,   45, -90, -105, -35, 1;
		

Crossrefs

Variant: A061176.

Programs

  • Magma
    A180957:= func< n,k | (&+[ (-1)^(k-j)*Binomial(n, j)*Binomial(n-j, 2*(k-j)) : j in [0..n]]) >;
    [A180957(n,k): k in [0..n], n in [0..15]]; // G. C. Greubel, Apr 06 2021
    
  • Mathematica
    T[n_, k_]:= Sum[(-1)^(k-j)*Binomial[n, j]*Binomial[n-j, 2*(k-j)], {j,0,n}];
    Table[T[n, k], {n,0,15}, {k,0,n}]//Flatten (* G. C. Greubel, Apr 06 2021 *)
  • Sage
    def A180957(n,k): return sum( (-1)^(k+j)*binomial(n,j)*binomial(n-j, 2*(k-j)) for j in (0..n))
    flatten([[A180957(n,k) for k in (0..n)] for n in [0..15]]) # G. C. Greubel, Apr 06 2021

Formula

G.f.: 1/(1 -x -x*y + x/(1 -x -x*y)) = (1 -x*(1+y))/(1 -2*x*(1+y) +x^2*(1 +3*y +y^2)).
E.g.f.: exp((1+y)*x) * cos(sqrt(y)*x).
T(n, k) = Sum_{j=0..n} (-1)^(k-j)*binomial(n,j)*binomial(n-j, 2*(k-j)).
Sum_{k=0..n} T(n, k) = A139011(n) (row sums).
Sum_{k=0..floor(n/2)} T(n-k, k) = A180958(n) (diagonal sums).