%I #11 Mar 04 2021 02:36:11
%S 1,1,1,1,16,1,1,47,47,1,1,103,974,103,1,1,195,5354,5354,195,1,1,336,
%T 19969,147068,19969,336,1,1,541,60085,1259253,1259253,60085,541,1,1,
%U 827,156386,7010503,44432886,7010503,156386,827,1,1,1213,365498,30299614,536255794,536255794,30299614,365498,1213,1
%N Triangle T(n, k) = T(n-1, k) + T(n-1, k-1) + ((n+1)*(n+2)*(2*n+3)/6)*T(n-2, k-1), read by rows.
%C Row sums are: {1, 2, 18, 96, 1182, 11100, 187680, 2639760, 58768320, ...}.
%C 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+1)*(n+2)*(2*n+3)/6 = A000330(n+1). - _G. C. Greubel_, Mar 02 2021
%H G. C. Greubel, <a href="/A154228/b154228.txt">Rows n = 0..50 of the triangle, flattened</a>
%F T(n, k) = T(n-1, k) + T(n-1, k-1) + ((n+1)*(n+2)*(2*n+3)/6)*T(n-2, k-1) with T(n, 0) = T(n, n) = 1.
%e Triangle begins as:
%e 1;
%e 1, 1;
%e 1, 16, 1;
%e 1, 47, 47, 1;
%e 1, 103, 974, 103, 1;
%e 1, 195, 5354, 5354, 195, 1;
%e 1, 336, 19969, 147068, 19969, 336, 1;
%e 1, 541, 60085, 1259253, 1259253, 60085, 541, 1;
%e 1, 827, 156386, 7010503, 44432886, 7010503, 156386, 827, 1;
%e 1, 1213, 365498, 30299614, 536255794, 536255794, 30299614, 365498, 1213, 1;
%p T:= proc(n, k) option remember;
%p if k=0 or k=n then 1
%p else T(n-1, k) + T(n-1, k-1) + ((n+1)*(n+2)*(2*n+3)/6)*T(n-2, k-1)
%p fi; end:
%p seq(seq(T(n, k), k=0..n), n=0..12); # _G. C. Greubel_, Mar 02 2021
%t T[n_, k_]:= T[n, k]= If[k==0 || k==n, 1, T[n-1, k] + T[n-1, k-1] + ((n+1)*(n+2)*(2*n+3)/6)*T[n-2, k-1]];
%t Table[T[n, k], {n,0,12}, {k,0,n}]//Flatten (* modified by _G. C. Greubel_, Mar 02 2021 *)
%o (Sage)
%o def f(n): return (n+1)*(n+2)*(2*n+3)/6
%o def T(n,k):
%o if (k==0 or k==n): return 1
%o else: return T(n-1, k) + T(n-1, k-1) + f(n)*T(n-2, k-1)
%o flatten([[T(n,k) for k in (0..n)] for n in (0..12)]) # _G. C. Greubel_, Mar 02 2021
%o (Magma)
%o f:= func< n | (n+1)*(n+2)*(2*n+3)/6 >;
%o function T(n,k)
%o if k eq 0 or k eq n then return 1;
%o else return T(n-1, k) + T(n-1, k-1) + f(n)*T(n-2, k-1);
%o end if; return T;
%o end function;
%o [T(n,k): k in [0..n], n in [0..12]]; // _G. C. Greubel_, Mar 02 2021
%Y Cf. A154227, A154229, A154230, A154231, A154233.
%Y Cf. A000330.
%K nonn,tabl
%O 0,5
%A _Roger L. Bagula_, Jan 05 2009
%E Edited by _G. C. Greubel_, Mar 02 2021