OFFSET
0,5
LINKS
G. C. Greubel, Rows n = 0..100 of triangle, flattened
Clark Kimberling, Path-counting and Fibonacci numbers, Fib. Quart. 40 (4) (2002) 328-338, Example 3B.
EXAMPLE
Rows begins as:
1;
1, 1;
1, 2, 1;
1, 5, 3, 1;
1, 11, 9, 4, 1;
...
MAPLE
T:= proc(i, j) option remember;
if i=0 or j=0 then 1
else add(add(T(h, m), m=0..j), h=0..i-1)
fi; end:
seq(seq(T(n-k, k), k=0..n), n=0..12); # G. C. Greubel, Jan 21 2020
MATHEMATICA
T[i_, j_]:= T[i, j]= If[i==0 || j==0, 1, Sum[T[h, m], {h, 0, i-1}, {m, 0, j}]]; Table[T[n-k, k], {n, 0, 12}, {k, 0, n}]//Flatten (* G. C. Greubel, Jan 21 2020 *)
PROG
(PARI) T(i, j) = if(i==0 || j==0, 1, sum(h=0, i-1, sum(m=0, j, T(h, m) )));
for(n=0, 12, for(k=0, n, print1(T(n-k, k), ", "))) \\ G. C. Greubel, Jan 21 2020
(Magma)
function T(i, j)
if i eq 0 or j eq 0 then return 1;
else return (&+[(&+[T(h, m): m in [0..j]]): h in [0..i-1]]);
end if; return T; end function;
[T(n-k, k): k in [0..n], n in [0..12]]; // G. C. Greubel, Jan 21 2020
(Sage)
@CachedFunction
def T(i, j):
if (i==0 or j==0): return 1
else: return sum(sum(T(h, m) for m in (0..j)) for h in (0..i-1))
[[T(n-k, k) for k in (0..n)] for n in (0..12)] # G. C. Greubel, Jan 21 2020
(GAP)
T:= function(i, j)
if i=0 or j=0 then return 1;
else return Sum([0..i-1], h-> Sum([0..j], m-> T(h, m) ));
fi; end;
Flat(List([0..12], n-> List([0..n], k-> T(n-k, k) ))); # G. C. Greubel, Jan 21 2020
CROSSREFS
KEYWORD
nonn,tabl
AUTHOR
Clark Kimberling, May 28 2000
STATUS
approved