OFFSET
0,8
COMMENTS
LINKS
G. C. Greubel, Rows n = 0..50 of the triangle, flattened
FORMULA
Since g.f. G=G(x) of A118346 satisfies: G = 1 - 2*x*G + 2*x*G^2 + x*G^3 then T(n,k) = T(n-1,k) - 2*T(n-1,k-1) + 2*T(n,k-1) + T(n+1,k-1). Also, a recurrence involving antidiagonals is: T(n,k) = T(n-1,k) + Sum_{j=1..k} [3*T(n-1+j,k-j) - 2*T(n-2+j,k-j)] for n>k>=0.
EXAMPLE
Show: T(n,k) = T(n-1,k) - 2*T(n-1,k-1) + 2*T(n,k-1) + T(n+1,k-1)
at n=8,k=4: T(8,4) = T(7,4) - 2*T(7,3) + 2*T(8,3) + T(9,3)
or: 1375 = 873 - 2*184 + 2*260 + 350.
Triangle begins:
1;
1, 0;
1, 1, 0;
1, 2, 5, 0;
1, 3, 11, 30, 0;
1, 4, 18, 70, 201, 0;
1, 5, 26, 121, 487, 1445, 0;
1, 6, 35, 184, 873, 3592, 10900, 0;
1, 7, 45, 260, 1375, 6606, 27600, 85128, 0;
1, 8, 56, 350, 2010, 10672, 51728, 218566, 682505, 0;
1, 9, 68, 455, 2796, 15996, 85182, 415629, 1771367, 5585115, 0;
MAPLE
T:= proc(n, k) option remember;
if k<0 or k>n then 0;
elif k=0 then 1;
elif k=n then 0;
else T(n-1, k) -2*T(n-1, k-1) +2*T(n, k-1) +T(n+1, k-1);
fi; end:
seq(seq(T(n, k), k=0..n), n=0..12); # G. C. Greubel, Mar 17 2021
MATHEMATICA
T[n_, k_]:= T[n, k]= If[k<0 || k>n, 0, If[k==0, 1, If[k==n, 0, T[n-1, k] -2*T[n-1, k-1] +2*T[n, k-1] +T[n+1, k-1] ]]];
Table[T[n, k], {n, 0, 10}, {k, 0, n}]//Flatten (* G. C. Greubel, Mar 17 2021 *)
PROG
(PARI) {T(n, k)=polcoeff((serreverse(x*(1-2*x+sqrt((1-2*x)*(1-6*x)+x*O(x^k)))/2/(1-2*x))/x)^(n-k), k)}
(Sage)
@CachedFunction
def T(n, k):
if (k<0 or k>n): return 0
elif (k==0): return 1
elif (k==n): return 0
else: return T(n-1, k) -2*T(n-1, k-1) +2*T(n, k-1) +T(n+1, k-1)
flatten([[T(n, k) for k in (0..n)] for n in (0..12)]) # G. C. Greubel, Mar 17 2021
CROSSREFS
KEYWORD
nonn,tabl
AUTHOR
Paul D. Hanna, Apr 26 2006
STATUS
approved