%I #16 Mar 01 2022 01:23:44
%S 1,3,3,9,36,9,27,297,297,27,81,2106,5346,2106,81,243,13851,73386,
%T 73386,13851,243,729,87480,868239,1761264,868239,87480,729,2187,
%U 540189,9388791,34158753,34158753,9388791,540189,2187,6561,3293622,95843088,578903274,1024762590,578903274,95843088,3293622,6561
%N Triangle read by rows: T(n, k) = t(n-k, k), where 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), and f(n) = 3*n + 3.
%H G. C. Greubel, <a href="/A257620/b257620.txt">Rows n = 0..50 of the triangle, flattened</a>
%F T(n, k) = t(n-k, k), where 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), and f(n) = 3*n + 3.
%F Sum_{k=0..n} T(n, k) = A034001(n).
%F From _G. C. Greubel_, Feb 28 2022: (Start)
%F t(k, n) = t(n, k).
%F T(n, n-k) = T(n, k).
%F t(0, n) = T(n, 0) = A000244(n). (End)
%e Array t(n,k) begins as:
%e 1, 3, 9, 27, 81, 243, ...;
%e 3, 36, 297, 2106, 13851, 87480, ...;
%e 9, 297, 5346, 73386, 868239, 9388791, ...;
%e 27, 2106, 73386, 1761264, 34158753, 578903274, ...;
%e 81, 13851, 868239, 34158753, 1024762590, 25791697782, ...;
%e 243, 87480, 9388791, 578903274, 25791697782, 928501120152, ...;
%e 729, 540189, 95843088, 8959544136, 575025893586, 28788563928042, ...;
%e Triangle T(n,k) begins as:
%e 1;
%e 3, 3;
%e 9, 36, 9;
%e 27, 297, 297, 27;
%e 81, 2106, 5346, 2106, 81;
%e 243, 13851, 73386, 73386, 13851, 243;
%e 729, 87480, 868239, 1761264, 868239, 87480, 729;
%e 2187, 540189, 9388791, 34158753, 34158753, 9388791, 540189, 2187;
%t t[n_, k_, p_, q_]:= t[n, k, p, q] = If[n<0 || k<0, 0, If[n==0 && k==0, 1, (p*k+q)*t[n-1,k,p,q] + (p*n+q)*t[n,k-1,p,q]]];
%t T[n_, k_, p_, q_]= t[n-k, k, p, q];
%t Table[T[n,k,3,3], {n,0,12}, {k,0,n}]//Flatten (* _G. C. Greubel_, Feb 28 2022 *)
%o (Sage)
%o @CachedFunction
%o def t(n,k,p,q):
%o if (n<0 or k<0): return 0
%o elif (n==0 and k==0): return 1
%o else: return (p*k+q)*t(n-1,k,p,q) + (p*n+q)*t(n,k-1,p,q)
%o def A257620(n,k): return t(n-k,k,3,3)
%o flatten([[A257620(n,k) for k in (0..n)] for n in (0..12)]) # _G. C. Greubel_, Feb 28 2022
%Y Cf. A000244, A034001 (row sums), A142458, A257610, A257622, A257624, A257626.
%Y Cf. A038221, A257180, A257611, A257621, A257623, A257625, A257627.
%Y Similar sequences listed in A256890.
%K nonn,tabl
%O 0,2
%A _Dale Gerdemann_, May 09 2015