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.

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

This page as a plain text file.
%I A288749 #12 May 24 2020 16:20:40
%S A288749 1,1,19,84,461,2222,10577,48943,222627,997735,4417674,19359659,
%T A288749 84099436,362570722,1552681071,6609823112,27989970166,117967914457,
%U A288749 495087382572,2069827499508,8623283249034,35811917284318,148289870077879,612382134256433,2522591250558641
%N A288749 Number of Dyck paths of semilength n such that the maximal number of peaks per level equals eight.
%H A288749 Alois P. Heinz, <a href="/A288749/b288749.txt">Table of n, a(n) for n = 8..1000</a>
%H A288749 Wikipedia, <a href="https://en.wikipedia.org/wiki/Lattice_path#Counting_lattice_paths">Counting lattice paths</a>
%p A288749 b:= proc(n, k, j) option remember; `if`(j=n, 1, add(
%p A288749       b(n-j, k, i)*add(binomial(i, m)*binomial(j-1, i-1-m),
%p A288749        m=max(0, i-j)..min(k, i-1)), i=1..min(j+k, n-j)))
%p A288749     end:
%p A288749 g:= proc(n, k) option remember; add(b(n, k, j), j=1..k) end:
%p A288749 a:= n-> g(n, 8)-g(n, 7):
%p A288749 seq(a(n), n=8..35);
%t A288749 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, 8] - g[n, 7], {n, 8, 35}] (* _Indranil Ghosh_, Aug 08 2017 *)
%o A288749 (Python)
%o A288749 from sympy.core.cache import cacheit
%o A288749 from sympy import binomial
%o A288749 @cacheit
%o A288749 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 A288749 def g(n, k): return sum(b(n, k, j) for j in range(1, k + 1))
%o A288749 def a(n): return g(n, 8) - g(n, 7)
%o A288749 print([a(n) for n in range(8, 36)]) # _Indranil Ghosh_, Aug 08 2017
%Y A288749 Column k=8 of A287822.
%Y A288749 Cf. A000108.
%K A288749 nonn
%O A288749 8,3
%A A288749 _Alois P. Heinz_, Jun 14 2017