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.

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

This page as a plain text file.
%I A288750 #12 May 24 2020 16:21:12
%S A288750 1,1,21,98,568,2858,14128,67556,316490,1456952,6612520,29652948,
%T A288750 131613716,578987886,2527351698,10956840549,47212399022,202328867061,
%U A288750 862840720214,3663367687951,15491222396862,65268041732681,274068630138339,1147305286307251
%N A288750 Number of Dyck paths of semilength n such that the maximal number of peaks per level equals nine.
%H A288750 Alois P. Heinz, <a href="/A288750/b288750.txt">Table of n, a(n) for n = 9..1000</a>
%H A288750 Wikipedia, <a href="https://en.wikipedia.org/wiki/Lattice_path#Counting_lattice_paths">Counting lattice paths</a>
%p A288750 b:= proc(n, k, j) option remember; `if`(j=n, 1, add(
%p A288750       b(n-j, k, i)*add(binomial(i, m)*binomial(j-1, i-1-m),
%p A288750        m=max(0, i-j)..min(k, i-1)), i=1..min(j+k, n-j)))
%p A288750     end:
%p A288750 g:= proc(n, k) option remember; add(b(n, k, j), j=1..k) end:
%p A288750 a:= n-> g(n, 9)-g(n, 8):
%p A288750 seq(a(n), n=9..35);
%t A288750 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, 9] - g[n, 8], {n, 9, 35}] (* _Indranil Ghosh_, Aug 08 2017 *)
%o A288750 (Python)
%o A288750 from sympy.core.cache import cacheit
%o A288750 from sympy import binomial
%o A288750 @cacheit
%o A288750 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 A288750 def g(n, k): return sum(b(n, k, j) for j in range(1, k + 1))
%o A288750 def a(n): return g(n, 9) - g(n, 8)
%o A288750 print([a(n) for n in range(9, 36)]) # _Indranil Ghosh_, Aug 08 2017
%Y A288750 Column k=9 of A287822.
%Y A288750 Cf. A000108.
%K A288750 nonn
%O A288750 9,3
%A A288750 _Alois P. Heinz_, Jun 14 2017