login
A157637
Triangle, T(n, k, m) = 1 if (k=0 or k=n), otherwise (m*(n-k) + 1)*T(n-1, k-1, m) + (m*k + 1)*T(n-1, k, m) + m*A157636(n, k)*T(n-2, k-1, m) for m = 1, read by rows.
1
1, 1, 1, 1, 5, 1, 1, 16, 16, 1, 1, 42, 136, 42, 1, 1, 99, 816, 816, 99, 1, 1, 219, 3951, 10200, 3951, 219, 1, 1, 466, 16632, 94827, 94827, 16632, 466, 1, 1, 968, 63670, 716160, 1601070, 716160, 63670, 968, 1, 1, 1981, 228112, 4657522, 20836740, 20836740, 4657522, 228112, 1981, 1
OFFSET
0,5
COMMENTS
For the case of m = 0 the triangle becomes T(n, k, 0) = A007318(n, k). - G. C. Greubel, Dec 13 2021
FORMULA
T(n, k, m) = 1 if (k=0 or k=n), otherwise (m*(n-k) + 1)*T(n-1, k-1, m) + (m*k + 1)*T(n-1, k, m) + m*A157636(n, k)*T(n-2, k-1, m) for m = 1.
T(n, k) = T(n, n-k). - G. C. Greubel, Dec 13 2021
EXAMPLE
Triangle begins as:
1;
1, 1;
1, 5, 1;
1, 16, 16, 1;
1, 42, 136, 42, 1;
1, 99, 816, 816, 99, 1;
1, 219, 3951, 10200, 3951, 219, 1;
1, 466, 16632, 94827, 94827, 16632, 466, 1;
1, 968, 63670, 716160, 1601070, 716160, 63670, 968, 1;
1, 1981, 228112, 4657522, 20836740, 20836740, 4657522, 228112, 1981, 1;
MATHEMATICA
A157636[n_, k_]:= If[k==0||k==n, 1, n*k*(n-k)/2];
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*A157636[n, k]*T[n-2, k-1, m]];
Table[T[n, k, 1], {n, 0, 12}, {k, 0, n}]//Flatten
PROG
(Sage)
@CachedFunction
def A157636(n, k): return 1 if (k==0 or k==n) else n*k*(n-k)/2
def T(n, k, q): return 1 if (k==0 or k==n) else (q*(n-k) +1)*T(n-1, k-1, q) + (q*k + 1)*T(n-1, k, q) + q*A157636(n, k)*T(n-2, k-1, q)
flatten([[T(n, k, 1) for k in (0..n)] for n in (0..15)]) # G. C. Greubel, Dec 13 2021
CROSSREFS
KEYWORD
nonn,tabl
AUTHOR
Roger L. Bagula, Mar 03 2009
EXTENSIONS
Edited by G. C. Greubel, Dec 13 2021
STATUS
approved