OFFSET
0,5
LINKS
G. C. Greubel, Rows n = 0..50 of the triangle, flattened
FORMULA
T(n, k) = T(n, k-1) - (-1)^k * Sum_{j=0..n-k} T(n-k, j), with T(n, 0) = 1, and T(n, 1) = Sum_{j=0..n-1} T(n-1, j).
Sum_{k=0..n} T(n, k) = A054091(n).
EXAMPLE
Triangle begins as:
1;
1, 1;
1, 2, 1;
1, 4, 2, 3;
1, 10, 6, 8, 7;
1, 32, 22, 26, 24, 25;
1, 130, 98, 108, 104, 106, 105;
1, 652, 522, 554, 544, 548, 546, 547;
1, 3914, 3262, 3392, 3360, 3370, 3366, 3368, 3367;
1, 27400, 23486, 24138, 24008, 24040, 24030, 24034, 24032, 24033;
MATHEMATICA
T[n_, k_]:= T[n, k]= If[k==0, 1, If[k==1, Sum[T[n-1, j], {j, 0, n-1}], T[n, k-1] - (-1)^k*Sum[T[n-k, j], {j, 0, n-k}]]];
Table[T[n, k], {n, 0, 12}, {k, 0, n}]//Flatten (* G. C. Greubel, Jun 23 2022 *)
PROG
(PARI) {T(n, k)= local(A); if(k<0||k>n, 0, if(k==0, 1, A=vector(n, i, (i>1)+1); for(i=2, n-1, A[i+1]=(i-1)*A[i]+2); sum(i=0, k-1, (-1)^i*A[n-i])))} /* Michael Somos, Nov 19 2006 */
(SageMath)
@CachedFunction
def T(n, k): # T = A054090
if (k==0): return 1
elif (k==1): return sum(T(n-1, j) for j in (0..n-1))
else: return T(n, k-1) - (-1)^k*sum(T(n-k, j) for j in (0..n-k))
flatten([[T(n, k) for k in (0..n)] for n in (0..12)]) # G. C. Greubel, Jun 23 2022
CROSSREFS
KEYWORD
AUTHOR
STATUS
approved