OFFSET
0,2
LINKS
G. C. Greubel, Rows n = 0..50 of the triangle, flattened
FORMULA
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) = 2*n + 3.
Sum_{k=0..n} T(n, k) = A051578(n).
From G. C. Greubel, Feb 28 2022: (Start)
t(k, n) = t(n, k).
T(n, n-k) = T(n, k).
t(0, n) = T(n, 0) = A000244(n). (End)
EXAMPLE
Array t(n,k) begins as:
1, 3, 9, 27, 81, 243, ...;
3, 30, 213, 1308, 7431, 40314, ...;
9, 213, 2982, 32646, 310263, 2695923, ...;
27, 1308, 32646, 587628, 8701545, 113360904, ...;
81, 7431, 310263, 8701545, 191433990, 3579465642, ...;
243, 40314, 2695923, 113360904, 3579465642, 93066106692, ...;
729, 212505, 22059036, 1351133676, 59641127202, 2104476295026, ...;
Triangle T(n,k) begins as:
1;
3, 3;
9, 30, 9;
27, 213, 213, 27;
81, 1308, 2982, 1308, 81;
243, 7431, 32646, 32646, 7431, 243;
729, 40314, 310263, 587628, 310263, 40314, 729;
2187, 212505, 2695923, 8701545, 8701545, 2695923, 212505, 2187;
MATHEMATICA
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[n_, k_, p_, q_]= t[n-k, k, p, q];
Table[T[n, k, 2, 3], {n, 0, 12}, {k, 0, n}]//Flatten (* G. C. Greubel, Feb 28 2022 *)
PROG
(PARI) f(x) = 2*x + 3;
T(n, k) = t(n-k, k);
t(n, m) = if (!n && !m, 1, if (n < 0 || m < 0, 0, f(m)*t(n-1, m) + f(n)*t(n, m-1)));
tabl(nn) = for (n=0, nn, for (k=0, n, print1(T(n, k), ", "); ); print(); ); \\ Michel Marcus, May 06 2015
(Sage)
@CachedFunction
def t(n, k, p, q):
if (n<0 or k<0): return 0
elif (n==0 and k==0): return 1
else: return (p*k+q)*t(n-1, k, p, q) + (p*n+q)*t(n, k-1, p, q)
def A257611(n, k): return t(n-k, k, 2, 3)
flatten([[A257611(n, k) for k in (0..n)] for n in (0..12)]) # G. C. Greubel, Feb 28 2022
CROSSREFS
Similar sequences listed in A256890.
KEYWORD
nonn,tabl
AUTHOR
Dale Gerdemann, May 06 2015
STATUS
approved