[go: up one dir, main page]
More Web Proxy on the site http://driver.im/
login

Year-end appeal: Please make a donation to the OEIS Foundation to support ongoing development and maintenance of the OEIS. We are now in our 61st year, we have over 378,000 sequences, and we’ve reached 11,000 citations (which often say “discovered thanks to the OEIS”).

A157147
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 = 1, read by rows.
23
1, 1, 1, 1, 5, 1, 1, 15, 15, 1, 1, 37, 110, 37, 1, 1, 83, 568, 568, 83, 1, 1, 177, 2415, 5534, 2415, 177, 1, 1, 367, 9137, 41027, 41027, 9137, 367, 1, 1, 749, 32104, 255155, 498814, 255155, 32104, 749, 1, 1, 1515, 107442, 1409814, 4845540, 4845540, 1409814, 107442, 1515, 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 = 1.
T(n, n-k) = T(n, k).
EXAMPLE
1;
1, 1;
1, 5, 1;
1, 15, 15, 1;
1, 37, 110, 37, 1;
1, 83, 568, 568, 83, 1;
1, 177, 2415, 5534, 2415, 177, 1;
1, 367, 9137, 41027, 41027, 9137, 367, 1;
1, 749, 32104, 255155, 498814, 255155, 32104, 749, 1;
1, 1515, 107442, 1409814, 4845540, 4845540, 1409814, 107442, 1515, 1;
MAPLE
A157147:= proc(n, k)
option remember;
if k < 0 or k> n then 0;
elif k = 0 or k = n then 1;
else (n-k+1)*procname(n-1, k-1) +(k+1)*procname(n-1, k) +k*(n-k)*procname(n-2, k-1);
end if;
end proc:
seq(seq(A157147(n, k), k=0..n), n=0..10); # R. J. Mathar, Feb 06 2015
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)
def T(n, k, m): # A157147
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..10)]) # G. C. Greubel, Jan 09 2022
KEYWORD
nonn,tabl,easy
AUTHOR
Roger L. Bagula, Feb 24 2009
EXTENSIONS
Edited by G. C. Greubel, Jan 09 2022
STATUS
approved