OFFSET
0,4
LINKS
G. C. Greubel, Rows n = 0..50 of the triangle, flattened
FORMULA
EXAMPLE
Triangle begins:
1;
1, 1;
2, 2, 1;
4, 4, 3, 1;
7, 8, 7, 4, 1;
13, 13, 15, 11, 5, 1;
MATHEMATICA
b[n_]:= b[n]= If[n<2, 0, If[n==2, 1, b[n-1] +b[n-2] +b[n-3]]]; (* A000073 *)
T[n_, k_]:= T[n, k]= If[k<0 || k>n, 0, If[k==0, b[n+2], T[n-1, k-1] +T[n-1, k]]];
Table[T[n, k], {n, 0, 12}, {k, 0, n}]//Flatten (* G. C. Greubel, Aug 06 2021 *)
PROG
(Sage)
@CachedFunction
def b(n): return 0 if (n<2) else 1 if (n==2) else b(n-1) +b(n-2) +b(n-3)
def T(n, k):
if (k<0 or k>n): return 0
elif (k==0): return b(n+2)
else: return T(n-1, k) + T(n-1, k-1)
flatten([[T(n, k) for k in (0..n)] for n in (0..12)]) # G. C. Greubel, Aug 06 2021
CROSSREFS
KEYWORD
AUTHOR
Paul Barry, May 06 2005
STATUS
approved