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”).

A287901
Number of Dyck paths of semilength n such that each positive level up to the highest nonempty level has at least one peak.
4
1, 1, 1, 3, 6, 17, 49, 147, 459, 1476, 4856, 16282, 55466, 191474, 668510, 2356944, 8380944, 30025814, 108289093, 392871484, 1432934360, 5251507624, 19329771911, 71430479820, 264914270527, 985737417231, 3679051573264, 13769781928768, 51670641652576
OFFSET
0,4
LINKS
EXAMPLE
. a(3) = 3:
. /\ /\
. /\/\/\ /\/ \ / \/\ .
.
. a(4) = 6:
. /\ /\ /\/\ /\ /\/\
. /\/\/\/\ /\/\/ \ /\/ \/\ /\/ \ / \/\/\ / \/\ .
MATHEMATICA
b[n_, k_, j_]:=b[n, k, j]=If[j==n, 1, Sum[Sum[Binomial[i, m] Binomial[j - 1, i - 1 - m], {m, Max[k, i - j], i - 1}] b[n - j, k, i], {i, n - j}]]; a[n_]:=If[n==0, 1, Sum[b[n, 1, j], {j, n}]]; Table[a[n], {n, 0, 30}] (* Indranil Ghosh, Aug 09 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([sum([binomial(i, m)*binomial(j - 1, i - 1 - m) for m in range(max(k, i - j), i)])*b(n - j, k, i) for i in range(1, n - j + 1)])
def a(n): return 1 if n==0 else sum([b(n, 1, j) for j in range(1, n + 1)])
print([a(n) for n in range(31)]) # Indranil Ghosh, Aug 09 2017
CROSSREFS
Column k=1 of A288386.
Sequence in context: A204517 A307685 A360273 * A354878 A143093 A117712
KEYWORD
nonn
AUTHOR
Alois P. Heinz, Jun 02 2017
STATUS
approved