OFFSET
0,4
COMMENTS
See the comments in A371763.
FORMULA
T(n, k) = n^3 if n=k, otherwise 2*binomial(k + 3, k)*3^(n - k + 1) - 6*binomial(k + 2, k)*2^(n - k + 1) + 7*(k + 1). - Detlef Meya, Apr 21 2024
EXAMPLE
Triangle starts:
0: 0
1: 1, 1
2: 13, 14, 8
3: 73, 86, 57, 27
4: 301, 374, 273, 148, 64
5: 1081, 1382, 1065, 628, 305, 125
6: 3613, 4694, 3729, 2308, 1205, 546, 216
7: 11593, 15206, 12297, 7828, 4265, 2058, 889, 343
MAPLE
# Using function ATPtriangle from A371763.
ATPtriangle(3, 9);
# Or, after Detlef Meya:
T := (n, k) -> (k+1)*(7-(k+2)*(3*2^(n-k+1)-(k+3)*3^(n-k)))-`if`(n=k, 1, 0):
seq(seq(T(n, k), k = 0..n), n = 0..8); # Peter Luschny, Apr 21 2024
MATHEMATICA
T[n_, k_] := If[n==k, n^3, 2*Binomial[k + 3, k]*3^(n - k + 1) - 6*Binomial[k + 2, k]*2^(n - k + 1) + 7*(k + 1)]; Flatten[Table[T[n, k], {n, 0, 8}, {k, 0, n}]] (* Detlef Meya, Apr 21 2024 *)
PROG
CROSSREFS
KEYWORD
nonn,tabl
AUTHOR
Peter Luschny, Apr 15 2024
STATUS
approved