OFFSET
0,8
LINKS
Alois P. Heinz, Rows n = 0..200, flattened
EXAMPLE
T(4,2) = 3:
[(0,0), (0,1), (0,0), (0,1), (0,2)],
[(0,0), (0,1), (0,2), (0,1), (0,2)],
[(0,0), (0,1), (0,2), (0,3), (0,2)].
Triangle T(n,k) begins:
1;
0, 1;
1, 0, 1;
1, 2, 0, 1;
2, 3, 3, 0, 1;
7, 5, 6, 4, 0, 1;
10, 23, 9, 10, 5, 0, 1;
38, 35, 51, 14, 15, 6, 0, 1;
89, 131, 84, 94, 20, 21, 7, 0, 1;
229, 355, 309, 168, 155, 27, 28, 8, 0, 1;
752, 874, 947, 608, 300, 237, 35, 36, 9, 0, 1;
...
MAPLE
b:= proc(n, x, y) option remember; `if`(min(n, x, y, n-x-y)<0, 0,
`if`(n=0, 1, add(b(n-1, x-d[1], y-d[2]),
d=[[-1, 0], [0, 1], [0, -1], [1, -1]])))
end:
T:= (n, k)-> b(n, 0, k):
seq(seq(T(n, k), k=0..n), n=0..12);
MATHEMATICA
b[n_, x_, y_] := b[n, x, y] = If[Min[n, x, y, n - x - y] < 0, 0, If[n == 0, 1, Sum[b[n - 1, x - d[[1]], y - d[[2]]], {d, {{-1, 0}, {0, 1}, {0, -1}, {1, -1}}}]]];
T[n_, k_] := b[n, 0, k];
Table[T[n, k], {n, 0, 12}, {k, 0, n}] // Flatten (* Jean-François Alcover, May 14 2020, after Maple *)
CROSSREFS
KEYWORD
AUTHOR
Alois P. Heinz, Mar 11 2019
STATUS
approved