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.

A288747 Number of Dyck paths of semilength n such that the maximal number of peaks per level equals six.

This page as a plain text file.
%I A288747 #13 Apr 24 2021 08:45:13
%S A288747 1,1,15,59,288,1269,5580,24092,102847,434794,1824249,7600076,31459191,
%T A288747 129505739,530589496,2164696038,8798355232,35639564649,143919521948,
%U A288747 579526079335,2327484839124,9324921648372,37275509745894,148692946409186,591979810055622
%N A288747 Number of Dyck paths of semilength n such that the maximal number of peaks per level equals six.
%H A288747 Alois P. Heinz, <a href="/A288747/b288747.txt">Table of n, a(n) for n = 6..1000</a>
%H A288747 Wikipedia, <a href="https://en.wikipedia.org/wiki/Lattice_path#Counting_lattice_paths">Counting lattice paths</a>
%p A288747 b:= proc(n, k, j) option remember; `if`(j=n, 1, add(
%p A288747       b(n-j, k, i)*add(binomial(i, m)*binomial(j-1, i-1-m),
%p A288747        m=max(0, i-j)..min(k, i-1)), i=1..min(j+k, n-j)))
%p A288747     end:
%p A288747 g:= proc(n, k) option remember; add(b(n, k, j), j=1..k) end:
%p A288747 a:= n-> g(n, 6)-g(n, 5):
%p A288747 seq(a(n), n=6..35);
%t A288747 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, 6] - g[n, 5], {n, 6, 35}] (* _Indranil Ghosh_, Aug 08 2017 *)
%o A288747 (Python)
%o A288747 from sympy.core.cache import cacheit
%o A288747 from sympy import binomial
%o A288747 @cacheit
%o A288747 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 A288747 def g(n, k): return sum([b(n, k, j) for j in range(1, k + 1)])
%o A288747 def a(n): return g(n, 6) - g(n, 5)
%o A288747 print([a(n) for n in range(6, 36)]) # _Indranil Ghosh_, Aug 08 2017
%Y A288747 Column k=6 of A287822.
%Y A288747 Cf. A000108.
%K A288747 nonn
%O A288747 6,3
%A A288747 _Alois P. Heinz_, Jun 14 2017