%I #5 Mar 01 2021 21:51:20
%S 1,1,1,1,10,1,1,29,29,1,1,66,418,66,1,1,139,2572,2572,139,1,1,284,
%T 12215,65336,12215,284,1,1,573,52531,818287,818287,52531,573,1,1,1150,
%U 216688,7906658,39270110,7906658,216688,1150,1,1,2303,877934,68639058,989843392,989843392,68639058,877934,2303,1
%N Triangle T(n, k, m) = coefficients of p(x, n, m) where p(x,n,m) = (x+1)*p(x, n-1, m) + (2^(m+n-1) + 2^(n-2)*[n>=3])*x*p(x, n-2, m) and m=2, read by rows.
%C Row sums are: {1, 2, 12, 60, 552, 5424, 90336, 1742784, 55519104, 2118725376, 132153466368, ...}.
%H G. C. Greubel, <a href="/A154984/b154984.txt">Rows n = 0..50 of the triangle, flattened</a>
%F T(n, k, m) = coefficients of p(x, n, m) where p(x,n,m) = (x+1)*p(x, n-1, m) + (2^(m+n-1) + 2^(n-2)*[n>=3])*x*p(x, n-2, m) and m=2.
%F T(n, k, m) = T(n-1, k, m) + T(n-1, k-1, m) + (2^(n+m-1) + 2^(n-2)*[n>=3])*T(n-2, k-1, m) with T(n, 0, m) = T(n, n, m) = 1 and m=2. - _G. C. Greubel_, Mar 01 2021
%e Triangle begins as:
%e 1;
%e 1, 1;
%e 1, 10, 1;
%e 1, 29, 29, 1;
%e 1, 66, 418, 66, 1;
%e 1, 139, 2572, 2572, 139, 1;
%e 1, 284, 12215, 65336, 12215, 284, 1;
%e 1, 573, 52531, 818287, 818287, 52531, 573, 1;
%e 1, 1150, 216688, 7906658, 39270110, 7906658, 216688, 1150, 1;
%e 1, 2303, 877934, 68639058, 989843392, 989843392, 68639058, 877934, 2303, 1;
%t (* First program *)
%t p[x_, n_, m_]:= p[x,n,m] = If[n<2, n*x+1, (x+1)*p[x, n-1, m] + 2^(m+n-1)*x*p[x, n-2, m] + Boole[n>=3]*2^(n-2)*x*p[x, n-2, m] ];
%t Table[CoefficientList[ExpandAll[p[x,n,2]], x], {n,0,10}]//Flatten (* modified by _G. C. Greubel_, Mar 01 2021 *)
%t (* Second program *)
%t T[n_, k_, m_]:= T[n, k, m] = If[k==0 || k==n, 1, T[n-1, k, m] + T[n-1, k-1, m] +(2^(m+n-1) + Boole[n>=3]*2^(n-2))*T[n-2, k-1, m] ];
%t Table[T[n, k, 2], {n,0,12}, {k,0,n}]//Flatten (* _G. C. Greubel_, Mar 01 2021 *)
%o (Sage)
%o def T(n,k,m):
%o if (k==0 or k==n): return 1
%o elif (n<3): return T(n-1, k, m) + T(n-1, k-1, m) + 2^(n+m-1)*T(n-2, k-1, m)
%o else: return T(n-1, k, m) + T(n-1, k-1, m) + (2^(n+m-1) +2^(n-2))*T(n-2, k-1, m)
%o flatten([[T(n,k,2) for k in (0..n)] for n in (0..12)]) # _G. C. Greubel_, Mar 01 2021
%o (Magma)
%o function T(n,k,m)
%o if k eq 0 or k eq n then return 1;
%o elif (n lt 3) then return T(n-1, k, m) + T(n-1, k-1, m) + 2^(n+m-1)*T(n-2, k-1, m);
%o else return T(n-1, k, m) + T(n-1, k-1, m) + (2^(n+m-1)+2^(n-2))*T(n-2, k-1, m);
%o end if; return T;
%o end function;
%o [T(n,k,2): k in [0..n], n in [0..12]]; // _G. C. Greubel_, Mar 01 2021
%Y Cf. A154983 (m=0), A154985 (m=1), this sequence (m=2).
%Y Cf. A154979, A154980, A154982, A154986.
%K nonn,tabl
%O 0,5
%A _Roger L. Bagula_, Jan 18 2009
%E Edited by _G. C. Greubel_, Mar 01 2021
|