login
Triangle T(n, k) = coefficients of p(n, x), where p(n, x) = (-1)^n*(x+2-n)*(x+2)^(n-1), p(0, x) = 1, and p(1, x) = -1-x, read by rows.
2

%I #5 May 14 2021 17:38:46

%S 1,-1,-1,0,2,1,4,0,-3,-1,-16,-16,0,4,1,48,80,40,0,-5,-1,-128,-288,

%T -240,-80,0,6,1,320,896,1008,560,140,0,-7,-1,-768,-2560,-3584,-2688,

%U -1120,-224,0,8,1,1792,6912,11520,10752,6048,2016,336,0,-9,-1,-4096,-17920,-34560,-38400,-26880,-12096,-3360,-480,0,10,1

%N Triangle T(n, k) = coefficients of p(n, x), where p(n, x) = (-1)^n*(x+2-n)*(x+2)^(n-1), p(0, x) = 1, and p(1, x) = -1-x, read by rows.

%H G. C. Greubel, <a href="/A158285/b158285.txt">Rows n = 0..50 of the triangle, flattened</a>

%F T(n, k) = coefficients of the characteristic polynomials from the matrix defined by M = (m_{i,j}), m_{j,j} = -1, else 1.

%F T(n, k) = coefficients of p(n, x), where p(n, x) = (-1)^n*(x+2-n)*(x+2)^(n-1), p(0, x) = 1, and p(1, x) = -1-x. - _G. C. Greubel_, May 14 2021

%e Triangle begins as:

%e 1;

%e -1, -1;

%e 0, 2, 1;

%e 4, 0, -3, -1;

%e -16, -16, 0, 4, 1;

%e 48, 80, 40, 0, -5, -1;

%e -128, -288, -240, -80, 0, 6, 1;

%e 320, 896, 1008, 560, 140, 0, -7, -1;

%e -768, -2560, -3584, -2688, -1120, -224, 0, 8, 1;

%e 1792, 6912, 11520, 10752, 6048, 2016, 336, 0, -9, -1;

%e -4096, -17920, -34560, -38400, -26880, -12096, -3360, -480, 0, 10, 1;

%t (* First program *)

%t M[n_]:= Table[If[k==m, -1, 1], {k,0,n}, {m,0,n}];

%t Join[{{1}}, Table[CoefficientList[CharacteristicPolynomial[M[n], x], x], {n,0,10}]]//Flatten (* modified by _G. C. Greubel_, May 14 2021 *)

%t (* Second program *)

%t f[n_]:= If[n<2, (-1)^n*(1+n*x), (-1)^n*(x+2-n)*(x+2)^(n-1)];

%t T[n_, k_]:= SeriesCoefficient[f[n], {x,0,k}];

%t Table[T[n, k], {n,0,10}, {k,0,n}]//Flatten (* _G. C. Greubel_, May 14 2021 *)

%o (Sage)

%o def p(n,x): return (-1)^n*(1 + n*x) if (n<2) else (-1)^n*(2-n+x)*(2+x)^(n-1)

%o def T(n): return ( p(n,x) ).full_simplify().coefficients(sparse=False)

%o flatten([T(n) for n in (0..10)]) # _G. C. Greubel_, May 14 2021

%Y Cf. A158286.

%K sign,tabl,less

%O 0,5

%A _Roger L. Bagula_, Mar 15 2009

%E Edited by _G. C. Greubel_, May 14 2021