%I #7 Apr 06 2021 23:09:39
%S 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,
%T -9,1,1,-14,-49,-77,-77,-49,-14,1,1,-20,-70,-112,-125,-112,-70,-20,1,
%U 1,-27,-90,-126,-117,-117,-126,-90,-27,1,1,-35,-105,-90,45,131,45,-90,-105,-35,1
%N Generalized Narayana triangle for (-1)^n.
%H G. C. Greubel, <a href="/A180957/b180957.txt">Rows n = 0..50 of the triangle, flattened</a>
%F 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)).
%F E.g.f.: exp((1+y)*x) * cos(sqrt(y)*x).
%F T(n, k) = Sum_{j=0..n} (-1)^(k-j)*binomial(n,j)*binomial(n-j, 2*(k-j)).
%F Sum_{k=0..n} T(n, k) = A139011(n) (row sums).
%F Sum_{k=0..floor(n/2)} T(n-k, k) = A180958(n) (diagonal sums).
%e Triangle begins
%e 1;
%e 1, 1;
%e 1, 1, 1;
%e 1, 0, 0, 1;
%e 1, -2, -5, -2, 1;
%e 1, -5, -15, -15, -5, 1;
%e 1, -9, -30, -41, -30, -9, 1;
%e 1, -14, -49, -77, -77, -49, -14, 1;
%e 1, -20, -70, -112, -125, -112, -70, -20, 1;
%e 1, -27, -90, -126, -117, -117, -126, -90, -27, 1;
%e 1, -35, -105, -90, 45, 131, 45, -90, -105, -35, 1;
%t T[n_, k_]:= Sum[(-1)^(k-j)*Binomial[n, j]*Binomial[n-j, 2*(k-j)], {j,0,n}];
%t Table[T[n, k], {n,0,15}, {k,0,n}]//Flatten (* _G. C. Greubel_, Apr 06 2021 *)
%o (Magma)
%o A180957:= func< n,k | (&+[ (-1)^(k-j)*Binomial(n, j)*Binomial(n-j, 2*(k-j)) : j in [0..n]]) >;
%o [A180957(n,k): k in [0..n], n in [0..15]]; // _G. C. Greubel_, Apr 06 2021
%o (Sage)
%o def A180957(n,k): return sum( (-1)^(k+j)*binomial(n,j)*binomial(n-j, 2*(k-j)) for j in (0..n))
%o flatten([[A180957(n,k) for k in (0..n)] for n in [0..15]]) # _G. C. Greubel_, Apr 06 2021
%Y Cf. A056241, A139011.
%Y Variant: A061176.
%K easy,sign,tabl
%O 0,12
%A _Paul Barry_, Sep 28 2010