login
Triangle, T(n, k) = coefficients [x^k]( p(x, n) ), where p(x, n) = (1+x)^n +2*x*[n=2] for n < 3, otherwise (1+x)^n + 2*(n*x+1)*(1+x)^(n-2) -2, read by rows.
1

%I #10 Jan 05 2024 12:56:26

%S 1,1,1,1,4,1,1,11,9,1,1,16,24,12,1,1,21,46,42,15,1,1,26,75,100,65,18,

%T 1,1,31,111,195,185,93,21,1,1,36,154,336,420,308,126,24,1,1,41,204,

%U 532,826,798,476,164,27,1,1,46,261,792,1470,1764,1386,696,207,30,1

%N Triangle, T(n, k) = coefficients [x^k]( p(x, n) ), where p(x, n) = (1+x)^n +2*x*[n=2] for n < 3, otherwise (1+x)^n + 2*(n*x+1)*(1+x)^(n-2) -2, read by rows.

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

%F T(n, k) = coefficients [x^k]( p(x, n) ), where p(x, n) = (1+x)^n + 2*(1+x)^(n-1) + 2*(n-1)*x*(1+x)^(n-2) for n > 2, p(x, 0) = 1, p(x, 1) = 1 + x, p(x, 2) = 1 + 4*x + x^2.

%F T(n, k) = [x^k]( p(x, n) ), where p(x, n) = (1+x)^n +2*x*[n=2] for n < 3, otherwise (1+x)^n + 2*(n*x+1)*(1+x)^(n-2) -2. - _G. C. Greubel_, Oct 27 2022

%e Triangle begins as:

%e 1;

%e 1, 1;

%e 1, 4, 1;

%e 1, 11, 9, 1;

%e 1, 16, 24, 12, 1;

%e 1, 21, 46, 42, 15, 1;

%e 1, 26, 75, 100, 65, 18, 1;

%e 1, 31, 111, 195, 185, 93, 21, 1;

%e 1, 36, 154, 336, 420, 308, 126, 24, 1;

%e 1, 41, 204, 532, 826, 798, 476, 164, 27, 1;

%e 1, 46, 261, 792, 1470, 1764, 1386, 696, 207, 30, 1;

%e 1, 51, 325, 1125, 2430, 3486, 3402, 2250, 975, 255, 33, 1;

%t p[x_, n_]= (1+x)^n +If[n>=1, -2 +2*(1+x)^(n-1), 0] +If[n>2, 2*(n-1)*x*(1+x)^(n- 2), 0];

%t Table[CoefficientList[p[x, n], x], {n,0,10}]//Flatten

%o (Magma) // As a triangle

%o function p(n,x)

%o if n le 1 then return (1+x)^n;

%o elif n eq 2 then return 1 +4*x +x^2;

%o else return (1+x)^n +2*(n*x+1)*(1+x)^(n-2) -2;

%o end if; return p;

%o end function;

%o R<x>:=PowerSeriesRing(Integers(), 30);

%o [Coefficients(R!( p(n,x) )): n in [0..12]]; // _G. C. Greubel_, Oct 27 2022

%o (SageMath)

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

%o flatten([[( p(n,x) ).series(x,n+1).list()[k] for k in range(n+1)] for n in (0..12)]) # _G. C. Greubel_, Oct 27 2022

%K nonn,tabl

%O 0,5

%A _Roger L. Bagula_, Nov 07 2008

%E Edited by _G. C. Greubel_, Oct 27 2022