login

Reminder: The OEIS is hiring a new managing editor, and the application deadline is January 26.

Number of Dyck paths of semilength n such that each level has exactly four peaks or no peaks.
2

%I #11 Jun 02 2018 10:36:06

%S 1,0,0,0,1,1,4,7,11,22,81,235,673,2063,5716,13627,33752,95729,298232,

%T 946563,2977953,9147328,27004159,76880498,217826819,637089405,

%U 1949908577,6160707450,19627448025,61909478550,191681762379,583025396879,1756696160636

%N Number of Dyck paths of semilength n such that each level has exactly four peaks or no peaks.

%H Alois P. Heinz, <a href="/A288111/b288111.txt">Table of n, a(n) for n = 0..1000</a>

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

%e . a(6) = 4:

%e . /\/\/\/\

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

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

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

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

%p *binomial(j-1, i-1-k)), i=1..min(j+k, n-j)))

%p end:

%p a:= n-> `if`(n=0, 1, b(n, 4$2)):

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

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

%t a[n_] := If[n == 0, 1, b[n, 4, 4]];

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

%Y Column k=4 of A288108.

%K nonn

%O 0,7

%A _Alois P. Heinz_, Jun 05 2017