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.
%I A288745 #13 Apr 24 2021 08:45:07 %S A288745 1,1,11,38,163,648,2571,10173,40025,156087,605057,2335566,8980883, %T A288745 34412583,131431024,500437733,1900135511,7196366668,27191450135, %U A288745 102522926104,385785153584,1448985664032,5432879981201,20337296148823,76015000686028,283720418696600 %N A288745 Number of Dyck paths of semilength n such that the maximal number of peaks per level equals four. %H A288745 Alois P. Heinz, <a href="/A288745/b288745.txt">Table of n, a(n) for n = 4..1000</a> %H A288745 Wikipedia, <a href="https://en.wikipedia.org/wiki/Lattice_path#Counting_lattice_paths">Counting lattice paths</a> %p A288745 b:= proc(n, k, j) option remember; `if`(j=n, 1, add( %p A288745 b(n-j, k, i)*add(binomial(i, m)*binomial(j-1, i-1-m), %p A288745 m=max(0, i-j)..min(k, i-1)), i=1..min(j+k, n-j))) %p A288745 end: %p A288745 g:= proc(n, k) option remember; add(b(n, k, j), j=1..k) end: %p A288745 a:= n-> g(n, 4)-g(n, 3): %p A288745 seq(a(n), n=4..35); %t A288745 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, 4] - g[n, 3], {n, 4, 35}] (* _Indranil Ghosh_, Aug 08 2017 *) %o A288745 (Python) %o A288745 from sympy.core.cache import cacheit %o A288745 from sympy import binomial %o A288745 @cacheit %o A288745 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)]) %o A288745 def g(n, k): return sum([b(n, k, j) for j in range(1, k + 1)]) %o A288745 def a(n): return g(n, 4) - g(n, 3) %o A288745 print([a(n) for n in range(4, 36)]) # _Indranil Ghosh_, Aug 08 2017 %Y A288745 Column k=4 of A287822. %Y A288745 Cf. A000108. %K A288745 nonn %O A288745 4,3 %A A288745 _Alois P. Heinz_, Jun 14 2017