%I #8 Dec 13 2021 19:14:34
%S 1,1,1,1,5,1,1,16,16,1,1,42,136,42,1,1,99,816,816,99,1,1,219,3951,
%T 10200,3951,219,1,1,466,16632,94827,94827,16632,466,1,1,968,63670,
%U 716160,1601070,716160,63670,968,1,1,1981,228112,4657522,20836740,20836740,4657522,228112,1981,1
%N 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.
%C For the case of m = 0 the triangle becomes T(n, k, 0) = A007318(n, k). - _G. C. Greubel_, Dec 13 2021
%H G. C. Greubel, <a href="/A157637/b157637.txt">Rows n = 0..50 of the triangle, flattened</a>
%F 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.
%F T(n, k) = T(n, n-k). - _G. C. Greubel_, Dec 13 2021
%e Triangle begins as:
%e 1;
%e 1, 1;
%e 1, 5, 1;
%e 1, 16, 16, 1;
%e 1, 42, 136, 42, 1;
%e 1, 99, 816, 816, 99, 1;
%e 1, 219, 3951, 10200, 3951, 219, 1;
%e 1, 466, 16632, 94827, 94827, 16632, 466, 1;
%e 1, 968, 63670, 716160, 1601070, 716160, 63670, 968, 1;
%e 1, 1981, 228112, 4657522, 20836740, 20836740, 4657522, 228112, 1981, 1;
%t A157636[n_, k_]:= If[k==0||k==n, 1, n*k*(n-k)/2];
%t 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]];
%t Table[T[n,k,1], {n,0,12}, {k,0,n}]//Flatten
%o (Sage)
%o @CachedFunction
%o def A157636(n,k): return 1 if (k==0 or k==n) else n*k*(n-k)/2
%o 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)
%o flatten([[T(n,k,1) for k in (0..n)] for n in (0..15)]) # _G. C. Greubel_, Dec 13 2021
%Y Cf. A007318, A157523, A157636.
%K nonn,tabl
%O 0,5
%A _Roger L. Bagula_, Mar 03 2009
%E Edited by _G. C. Greubel_, Dec 13 2021