OFFSET
0,4
COMMENTS
T(n,j,k) is the number of lattice paths from (0,0,0) to (n,j,k) with steps (1,0,0), (1,1,0) and two kinds of steps (1,1,1).
The sum of the terms in each slice of the pyramid is 4^n (A000302).
The terms of the j-th row of the n-th slice of this pyramid are the sum of the terms in each row of the j-th triangle of the n-th slice of A189225. - Dimitri Boscainos, Aug 21 2015
LINKS
Alois P. Heinz, Rows n = 0..38, flattened
FORMULA
T(i+1,j,k) = 2*T(i,j-1,k-1)+T(i,j-1,k)+T(i,j,k); T(i,j,-1)=0,...; T(0,0,0)=1.
T(n,j,k) = 2^k*binomial(n,j)*binomial(j,k). - Dimitri Boscainos, Aug 21 2015
EXAMPLE
Here is the fourth (n=3) slice of the pyramid:
.....1......
...3 6....
..3 12 12.
.1 6 12 8
As an irregular triangle, rows begin:
1;
1, 1, 2;
1, 2, 4, 1, 4, 4;
1, 3, 6, 3, 12, 12, 1, 6, 12, 8;
...
MAPLE
p:= proc(i, j, k) option remember;
if k<0 or i<0 or i>k or j<0 or j>i then 0
elif {i, j, k}={0} then 1
else p(i, j, k-1) +p(i-1, j, k-1) +2*p(i-1, j-1, k-1)
fi
end:
seq(seq(seq(p(i, j, k), j=0..i), i=0..k), k=0..5);
# Alois P. Heinz, Aug 20 2015
MATHEMATICA
p[i_, j_, k_] := p[i, j, k] = If[k < 0 || i < 0 || i > k || j < 0 || j > i, 0, If[Union@{i, j, k} == {0}, 1, p[i, j, k - 1] + p[i - 1, j, k - 1] + 2* p[i - 1, j - 1, k - 1]]];
Table[Table[Table[p[i, j, k], {j, 0, i}], {i, 0, k}], {k, 0, 5}] // Flatten (* Jean-François Alcover, Sep 16 2023, after Alois P. Heinz *)
CROSSREFS
KEYWORD
nonn,tabf
AUTHOR
Dimitri Boscainos, Aug 16 2015
STATUS
approved