login
Number of Dyck paths of semilength 2n such that the maximal number of peaks per level equals n.
2

%I #10 Jun 02 2018 10:35:45

%S 1,1,7,29,163,925,5580,34751,222627,1456952,9699872,65474460,

%T 446971110,3080074508,21393773841,149614083615,1052537452164,

%U 7443584137525,52888757972865,377382278671610,2703141489113003,19430405608302831,140118758417377105

%N Number of Dyck paths of semilength 2n such that the maximal number of peaks per level equals n.

%H Alois P. Heinz, <a href="/A287860/b287860.txt">Table of n, a(n) for n = 0..100</a>

%H Wikipedia, <a href="https://en.wikipedia.org/wiki/Lattice_path#Counting_lattice_paths">Counting lattice paths</a>

%F a(n) = A287822(2n,n).

%e . /\ /\ /\/\

%e . a(2) = 7: /\/\/ \ /\/ \/\ /\/ \

%e .

%e . /\/\

%e . /\ /\ /\ /\/\ / \

%e . / \/\/\ / \/ \ / \/\ / \ .

%p b:= proc(n, k, j) option remember; `if`(j=n, 1, add(

%p b(n-j, k, i)*add(binomial(i, m)*binomial(j-1, i-1-m),

%p m=max(0, i-j)..min(k, i-1)), i=1..min(j+k, n-j)))

%p end:

%p g:= proc(n, k) option remember; add(b(n, k, j), j=1..k) end:

%p a:= n-> `if`(n=0, 1, g(2*n, n)-g(2*n, n-1)):

%p seq(a(n), n=0..23);

%t b[n_, k_, j_] := b[n, k, j] = If[j == n, 1, Sum[b[n - j, k, i]*Sum[ Binomial[i, m] * Binomial[j - 1, i - 1 - m], {m, Max[0, i - j], Min[k, i - 1]}], {i, 1, Min[j + k, n - j]}]];

%t g[n_, k_] := g[n, k] = Sum[b[n, k, j], {j, 1, k}];

%t a[n_] := If[n == 0, 1, g[2*n, n] - g[2*n, n - 1]];

%t Table[a[n], {n, 0, 23}] (* _Jean-François Alcover_, Jun 02 2018, from Maple *)

%Y Cf. A287822.

%K nonn

%O 0,3

%A _Alois P. Heinz_, Jun 01 2017