OFFSET
0,5
LINKS
G. C. Greubel, Rows n = 0..50 of the triangle, flattened
FORMULA
T(n, k, m) = (m*(n-k) + 1)*T(n-1, k-1, m) + (m*k + 1)*T(n-1, k, m) - m*k*(n-k)*T(n-2, k-1, m) with T(n, 0, m) = T(n, n, m) = 1 and m = 5.
T(n, n-k, m) = T(n, k, m).
T(n, 1, 1) = A000225(n). - G. C. Greubel, Jan 09 2022
EXAMPLE
Triangle begins as:
1;
1, 1;
1, 3, 1;
1, 7, 7, 1;
1, 15, 30, 15, 1;
1, 31, 108, 108, 31, 1;
1, 63, 359, 594, 359, 63, 1;
1, 127, 1145, 2875, 2875, 1145, 127, 1;
1, 255, 3568, 12985, 19246, 12985, 3568, 255, 1;
1, 511, 10966, 56306, 116640, 116640, 56306, 10966, 511, 1;
1, 1023, 33417, 238024, 665702, 918530, 665702, 238024, 33417, 1023, 1;
MATHEMATICA
T[n_, k_, m_]:= T[n, k, m]= If[k==0 || k==n, 1, (m*(n-k)+1)*T[n-1, k-1, m] + (m*k+1)*T[n-1, k, m] - m*k*(n-k)*T[n-2, k-1, m]];
Table[T[n, k, 1], {n, 0, 10}, {k, 0, n}]//Flatten (* modified by G. C. Greubel, Jan 09 2022 *)
PROG
(Sage)
@CachedFunction
def T(n, k, m): # A157152
if (k==0 or k==n): return 1
else: return (m*(n-k) +1)*T(n-1, k-1, m) + (m*k+1)*T(n-1, k, m) - m*k*(n-k)*T(n-2, k-1, m)
flatten([[T(n, k, 1) for k in (0..n)] for n in (0..20)]) # G. C. Greubel, Jan 09 2022
CROSSREFS
KEYWORD
AUTHOR
Roger L. Bagula, Feb 24 2009
EXTENSIONS
Edited by G. C. Greubel, Jan 09 2022
STATUS
approved