cp's OEIS Frontend

This is a front-end for the Online Encyclopedia of Integer Sequences, made by Christian Perfect. The idea is to provide OEIS entries in non-ancient HTML, and then to think about how they're presented visually. The source code is on GitHub.

A287901 Number of Dyck paths of semilength n such that each positive level up to the highest nonempty level has at least one peak.

This page as a plain text file.
%I A287901 #20 Apr 22 2021 08:47:09
%S A287901 1,1,1,3,6,17,49,147,459,1476,4856,16282,55466,191474,668510,2356944,
%T A287901 8380944,30025814,108289093,392871484,1432934360,5251507624,
%U A287901 19329771911,71430479820,264914270527,985737417231,3679051573264,13769781928768,51670641652576
%N A287901 Number of Dyck paths of semilength n such that each positive level up to the highest nonempty level has at least one peak.
%H A287901 Alois P. Heinz, <a href="/A287901/b287901.txt">Table of n, a(n) for n = 0..300</a>
%H A287901 Wikipedia, <a href="https://en.wikipedia.org/wiki/Lattice_path#Counting_lattice_paths">Counting lattice paths</a>
%e A287901 . a(3) = 3:
%e A287901 .                   /\      /\
%e A287901 .      /\/\/\    /\/  \    /  \/\ .
%e A287901 .
%e A287901 . a(4) = 6:
%e A287901 .                    /\      /\        /\/\    /\        /\/\
%e A287901 .     /\/\/\/\  /\/\/  \  /\/  \/\  /\/    \  /  \/\/\  /    \/\ .
%t A287901 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 *)
%o A287901 (Python)
%o A287901 from sympy.core.cache import cacheit
%o A287901 from sympy import binomial
%o A287901 @cacheit
%o A287901 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)])
%o A287901 def a(n): return 1 if n==0 else sum([b(n, 1, j) for j in range(1, n + 1)])
%o A287901 print([a(n) for n in range(31)]) # _Indranil Ghosh_, Aug 09 2017
%Y A287901 Column k=1 of A288386.
%Y A287901 Cf. A000108, A281874, A287846.
%K A287901 nonn
%O A287901 0,4
%A A287901 _Alois P. Heinz_, Jun 02 2017