login
A157155
Triangle 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 = 4, read by rows.
23
1, 1, 1, 1, 6, 1, 1, 31, 31, 1, 1, 156, 462, 156, 1, 1, 781, 5442, 5442, 781, 1, 1, 3906, 57263, 124860, 57263, 3906, 1, 1, 19531, 566153, 2335435, 2335435, 566153, 19531, 1, 1, 97656, 5396164, 38814088, 71413750, 38814088, 5396164, 97656, 1
OFFSET
0,5
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 = 4.
T(n, n-k, m) = T(n, k, m).
T(n, 1, 4) = A003463(n). - G. C. Greubel, Jan 10 2022
EXAMPLE
Triangle begins as:
1;
1, 1;
1, 6, 1;
1, 31, 31, 1;
1, 156, 462, 156, 1;
1, 781, 5442, 5442, 781, 1;
1, 3906, 57263, 124860, 57263, 3906, 1;
1, 19531, 566153, 2335435, 2335435, 566153, 19531, 1;
1, 97656, 5396164, 38814088, 71413750, 38814088, 5396164, 97656, 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, 4], {n, 0, 10}, {k, 0, n}]//Flatten (* modified by G. C. Greubel, Jan 10 2022 *)
PROG
(Sage)
@CachedFunction
def T(n, k, m): # A157155
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, 4) for k in (0..n)] for n in (0..20)]) # G. C. Greubel, Jan 10 2022
CROSSREFS
Cf. A007318 (m=0), A157152 (m=1), A157153 (m=2), A157154 (m=3), this sequence (m=4), A157156 (m=5).
Cf. A003463.
Sequence in context: A111578 A166349 A176429 * A022169 A156601 A178232
KEYWORD
nonn,tabl
AUTHOR
Roger L. Bagula, Feb 24 2009
EXTENSIONS
Edited by G. C. Greubel, Jan 10 2022
STATUS
approved