A288319 Number of Dyck paths of semilength n such that each positive level has exactly three peaks.
1, 0, 0, 1, 0, 0, 0, 4, 20, 20, 0, 16, 200, 1120, 3540, 6864, 9400, 18240, 82000, 364256, 1255040, 3448400, 8094400, 18653984, 50789120, 166596240, 565558400, 1791310496, 5202559520, 14279014880, 39040502400, 111437733184, 335085082880, 1032287357600
Offset: 0
Keywords
Examples
. a(7) = 4: . /\/\/\ /\/\/\ /\/\/\ /\/\/\ . /\/\/\/ \ /\/\/ \/\ /\/ \/\/\ / \/\/\/\ .
Links
- Alois P. Heinz, Table of n, a(n) for n = 0..1000
- Wikipedia, Counting lattice paths
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: a:= n-> `if`(n=0, 1, b(n, 3$2)): seq(a(n), n=0..35);
-
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]}]]; a[n_] := If[n == 0, 1, b[n, 3, 3]]; Table[a[n], {n, 0, 35}] (* Jean-François Alcover, Jun 02 2018, from Maple *)