A288318 Number T(n,k) of Dyck paths of semilength n such that each positive level has exactly k peaks; triangle T(n,k), n>=0, 0<=k<=n, read by rows.
1, 0, 1, 0, 0, 1, 0, 2, 0, 1, 0, 0, 0, 0, 1, 0, 4, 3, 0, 0, 1, 0, 6, 6, 0, 0, 0, 1, 0, 8, 0, 4, 0, 0, 0, 1, 0, 24, 9, 20, 0, 0, 0, 0, 1, 0, 52, 54, 20, 5, 0, 0, 0, 0, 1, 0, 96, 138, 0, 45, 0, 0, 0, 0, 0, 1, 0, 212, 207, 16, 105, 6, 0, 0, 0, 0, 0, 1, 0, 504, 360, 200, 70, 84, 0, 0, 0, 0, 0, 0, 1
Offset: 0
Examples
. T(5,1) = 4: . /\ /\ /\ /\ . /\/ \ / \/\ /\/ \ / \/\ . /\/ \ /\/ \ / \/\ / \/\ . . . T(5,2) = 3: . /\/\ /\/\ /\/\ . /\/\/ \ /\/ \/\ / \/\/\ . . Triangle T(n,k) begins: 1; 0, 1; 0, 0, 1; 0, 2, 0, 1; 0, 0, 0, 0, 1; 0, 4, 3, 0, 0, 1; 0, 6, 6, 0, 0, 0, 1; 0, 8, 0, 4, 0, 0, 0, 1; 0, 24, 9, 20, 0, 0, 0, 0, 1; 0, 52, 54, 20, 5, 0, 0, 0, 0, 1;
Links
- Alois P. Heinz, Rows n = 0..140, flattened
- Wikipedia, Counting lattice paths
Crossrefs
Programs
-
Maple
b:= proc(n, k, j) option remember; `if`(n=j, 1, add(b(n-j, k, i)*(binomial(i, k) *binomial(j-1, i-1-k)), i=1..min(j+k, n-j))) end: T:= (n, k)-> `if`(n=0, 1, b(n, k$2)): seq(seq(T(n, k), k=0..n), n=0..14);
-
Mathematica
b[n_, k_, j_] := b[n, k, j] = If[n == j, 1, Sum[b[n - j, k, i]*(Binomial[i, k]*Binomial[j - 1, i - 1 - k]), {i, 1, Min[j + k, n - j]}]]; T[n_, k_] := If[n == 0, 1, b[n, k, k]]; Table[T[n, k], {n, 0, 14}, {k, 0, n}] // Flatten (* Jean-François Alcover, May 25 2018, translated from Maple *)
Comments