login
A154233
Triangle T(n, k) = T(n-1, k) + T(n-1, k-1) + (n^2 +n -1)*T(n-2, k-1), read by rows.
6
1, 1, 1, 1, 7, 1, 1, 19, 19, 1, 1, 39, 171, 39, 1, 1, 69, 761, 761, 69, 1, 1, 111, 2429, 8533, 2429, 111, 1, 1, 167, 6335, 52817, 52817, 6335, 167, 1, 1, 239, 14383, 231611, 711477, 231611, 14383, 239, 1, 1, 329, 29485, 809809, 5643801, 5643801, 809809, 29485, 329, 1
OFFSET
0,5
COMMENTS
Row sums are: {1, 2, 9, 40, 251, 1662, 13615, 118640, 1203945, 12966850, ...}.
The row sums of this class of sequences (see cross references) is given by the following. Let S(n) be the row sum then S(n) = 2*S(n-1) + f(n)*S(n-2) for a given f(n). For this sequence f(n) = n^2 +n -1 = A028387(n-2). - G. C. Greubel, Mar 02 2021
FORMULA
T(n, k) = T(n-1, k) + T(n-1, k-1) + (n^2+n-1)*T(n-2, k-1) with T(n, 0) = T(n, n) = 1.
EXAMPLE
Triangle begins as:
1;
1, 1;
1, 7, 1;
1, 19, 19, 1;
1, 39, 171, 39, 1;
1, 69, 761, 761, 69, 1;
1, 111, 2429, 8533, 2429, 111, 1;
1, 167, 6335, 52817, 52817, 6335, 167, 1;
1, 239, 14383, 231611, 711477, 231611, 14383, 239, 1;
1, 329, 29485, 809809, 5643801, 5643801, 809809, 29485, 329, 1;
MAPLE
T:= proc(n, k) option remember;
if k=0 or k=n then 1
else T(n-1, k) + T(n-1, k-1) + (n^2+n-1)*T(n-2, k-1)
fi; end:
seq(seq(T(n, k), k=0..n), n=0..12); # G. C. Greubel, Mar 02 2021
MATHEMATICA
T[n_, k_]:= T[n, k]= If[k==0 || k==n, 1, T[n-1, k] + T[n-1, k-1] + (n^2+n-1)*T[n-2, k-1] ];
Table[T[n, k], {n, 0, 12}, {k, 0, n}]//Flatten (* modified by G. C. Greubel, Mar 02 2021 *)
PROG
(Sage)
def f(n): return n^2+n-1
def T(n, k):
if (k==0 or k==n): return 1
else: return T(n-1, k) + T(n-1, k-1) + f(n)*T(n-2, k-1)
flatten([[T(n, k) for k in (0..n)] for n in (0..12)]) # G. C. Greubel, Mar 02 2021
(Magma)
f:= func< n | n^2+n-1 >;
function T(n, k)
if k eq 0 or k eq n then return 1;
else return T(n-1, k) + T(n-1, k-1) + f(n)*T(n-2, k-1);
end if; return T;
end function;
[T(n, k): k in [0..n], n in [0..12]]; // G. C. Greubel, Mar 02 2021
CROSSREFS
KEYWORD
nonn,tabl
AUTHOR
Roger L. Bagula, Jan 05 2009
EXTENSIONS
Edited by G. C. Greubel, Mar 02 2021
STATUS
approved