%I #22 Mar 21 2022 03:06:04
%S 1,2,2,4,20,4,8,132,132,8,16,748,2112,748,16,32,3964,25124,25124,3964,
%T 32,64,20364,256488,552728,256488,20364,64,128,103100,2398092,9670840,
%U 9670840,2398092,103100,128,256,518444,21246736,147146804,270783520,147146804,21246736,518444,256
%N Triangle read by rows: T(n,k) = t(n-k, k); t(n,m) = f(m)*t(n-1,m) + f(n)*t(n,m-1), where f(x) = 3*x + 2.
%H G. C. Greubel, <a href="/A257610/b257610.txt">Rows n = 0..50 of the triangle, flattened</a>
%F T(n,k) = t(n-k, k); t(0,0) = 1, t(n,m) = 0 if n < 0 or m < 0, else t(n,m) = f(m)*t(n-1,m) + f(n)*t(n,m-1), where f(x) = 3*x + 2.
%F Sum_{k=0..n} T(n, k) = A007559(n).
%F T(n, k) = (a*k + b)*T(n-1, k) + (a*(n-k) + b)*T(n-1, k-1), with T(n, 0) = 1, a = 3, and b = 2. - _G. C. Greubel_, Mar 20 2022
%e Triangle begins as:
%e 1;
%e 2, 2;
%e 4, 20, 4;
%e 8, 132, 132, 8;
%e 16, 748, 2112, 748, 16;
%e 32, 3964, 25124, 25124, 3964, 32;
%e 64, 20364, 256488, 552728, 256488, 20364, 64;
%e 128, 103100, 2398092, 9670840, 9670840, 2398092, 103100, 128;
%e 256, 518444, 21246736, 147146804, 270783520, 147146804, 21246736, 518444, 256;
%t T[n_, k_, a_, b_]:= T[n, k, a, b]= If[k<0 || k>n, 0, If[n==0, 1, (a*(n-k)+b)*T[n-1, k-1, a, b] + (a*k+b)*T[n-1, k, a, b]]];
%t Table[T[n,k,3,2], {n,0,12}, {k,0,n}]//Flatten (* _G. C. Greubel_, Mar 20 2022 *)
%o (Sage)
%o def T(n,k,a,b): # A257610
%o if (k<0 or k>n): return 0
%o elif (n==0): return 1
%o else: return (a*k+b)*T(n-1,k,a,b) + (a*(n-k)+b)*T(n-1,k-1,a,b)
%o flatten([[T(n,k,3,2) for k in (0..n)] for n in (0..12)]) # _G. C. Greubel_, Mar 20 2022
%Y Cf. A007559 (row sums), A038208, A142458, A257620, A257622, A257624, A257626.
%Y Cf. A256890, A257609, A257610, A257612, A257614, A257616, A257617, A257618, A257619.
%Y See similar sequences listed in A256890.
%K nonn,tabl
%O 0,2
%A _Dale Gerdemann_, May 03 2015