login

Year-end appeal: Please make a donation to the OEIS Foundation to support ongoing development and maintenance of the OEIS. We are now in our 61st year, we have over 378,000 sequences, and we’ve reached 11,000 citations (which often say “discovered thanks to the OEIS”).

A288746
Number of Dyck paths of semilength n such that the maximal number of peaks per level equals five.
2
1, 1, 13, 48, 220, 925, 3895, 16137, 66399, 271446, 1101626, 4442143, 17822176, 71191082, 283269813, 1123212251, 4439583152, 17496345670, 68765995160, 269595218881, 1054499461385, 4115767918639, 16032123369549, 62333852291879, 241935803355457, 937486479689517
OFFSET
5,3
LINKS
MAPLE
b:= proc(n, k, j) option remember; `if`(j=n, 1, add(
b(n-j, k, i)*add(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)))
end:
g:= proc(n, k) option remember; add(b(n, k, j), j=1..k) end:
a:= n-> g(n, 5)-g(n, 4):
seq(a(n), n=5..35);
MATHEMATICA
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, Min[j + k, n - j]}]]; g[n_, k_]:=Sum[b[n, k, j], {j, k}]; Table[g[n, 5] - g[n, 4], {n, 5, 35}] (* Indranil Ghosh, Aug 08 2017 *)
PROG
(Python)
from sympy.core.cache import cacheit
from sympy import binomial
@cacheit
def b(n, k, j): return 1 if j==n else sum([b(n - j, k, i)*sum([binomial(i, m)*binomial(j - 1, i - 1 - m) for m in range(max(0, i - j), min(k, i - 1) + 1)]) for i in range(1, min(j + k, n - j) + 1)])
def g(n, k): return sum([b(n, k, j) for j in range(1, k + 1)])
def a(n): return g(n, 5) - g(n, 4)
print([a(n) for n in range(5, 36)]) # Indranil Ghosh, Aug 08 2017
CROSSREFS
Column k=5 of A287822.
Cf. A000108.
Sequence in context: A225920 A027980 A200254 * A220707 A189349 A013200
KEYWORD
nonn
AUTHOR
Alois P. Heinz, Jun 14 2017
STATUS
approved