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.

A288386 Number T(n,k) of Dyck paths of semilength n such that no positive level has fewer than k peaks; triangle T(n,k), n >= 0, 0 <= k <= n, read by rows.

This page as a plain text file.
%I A288386 #29 Jun 04 2020 03:28:24
%S A288386 1,1,1,2,1,1,5,3,1,1,14,6,1,1,1,42,17,4,1,1,1,132,49,14,1,1,1,1,429,
%T A288386 147,35,5,1,1,1,1,1430,459,91,30,1,1,1,1,1,4862,1476,268,96,6,1,1,1,1,
%U A288386 1,16796,4856,864,245,57,1,1,1,1,1,1,58786,16282,2833,592,247,7,1,1,1,1,1,1
%N A288386 Number T(n,k) of Dyck paths of semilength n such that no positive level has fewer than k peaks; triangle T(n,k), n >= 0, 0 <= k <= n, read by rows.
%C A288386 T(n,k) is defined for all n,k >= 0.  The triangle contains only the terms for k <= n. T(0,k) = 1, T(n,k) = 0 for k > n > 0.
%H A288386 Alois P. Heinz, <a href="/A288386/b288386.txt">Rows n = 0..140, flattened</a>
%H A288386 Wikipedia, <a href="https://en.wikipedia.org/wiki/Lattice_path#Counting_lattice_paths">Counting lattice paths</a>
%F A288386 T(n,k) = Sum_{i=k..n} A288387(n,i) if k <= n.
%e A288386 T(4,1) = 6:
%e A288386                     /\      /\        /\/\    /\        /\/\
%e A288386      /\/\/\/\  /\/\/  \  /\/  \/\  /\/    \  /  \/\/\  /    \/\ .
%e A288386 Triangle T(n,k) begins:
%e A288386      1;
%e A288386      1,    1;
%e A288386      2,    1,   1;
%e A288386      5,    3,   1,  1;
%e A288386     14,    6,   1,  1, 1;
%e A288386     42,   17,   4,  1, 1, 1;
%e A288386    132,   49,  14,  1, 1, 1, 1;
%e A288386    429,  147,  35,  5, 1, 1, 1, 1;
%e A288386   1430,  459,  91, 30, 1, 1, 1, 1, 1;
%e A288386   4862, 1476, 268, 96, 6, 1, 1, 1, 1, 1;
%p A288386 b:= proc(n, k, j) option remember; `if`(j=n, 1,
%p A288386       add(add(binomial(i, m)*binomial(j-1, i-1-m),
%p A288386       m=max(k, i-j)..i-1)*b(n-j, k, i), i=1..n-j))
%p A288386     end:
%p A288386 T:= proc(n, k) option remember; `if`(n=0, 1,
%p A288386       add(b(n, k, j), j=k..n))
%p A288386     end:
%p A288386 seq(seq(T(n, k), k=0..n), n=0..14);
%t A288386 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}]]; T[n_, k_]:=T[n, k]=If[n==0, 1, Sum[b[n, k, j], {j, k, n}]]; Table[T[n, k], {n, 0, 15}, {k, 0, n}] // Flatten (* _Indranil Ghosh_, Aug 09 2017 *)
%o A288386 (Python)
%o A288386 from sympy.core.cache import cacheit
%o A288386 from sympy import binomial
%o A288386 @cacheit
%o A288386 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 A288386 @cacheit
%o A288386 def T(n, k): return 1 if n==0 else sum(b(n, k, j) for j in range(k, n + 1))
%o A288386 for n in range(16): print([T(n, k) for k in range(n + 1)]) # _Indranil Ghosh_, Aug 09 2017
%Y A288386 Columns k=0-10 give: A000108, A287901, A288678, A288679, A288680, A288681, A288682, A288683, A288684, A288685, A288686.
%Y A288386 Cf. A287847, A288387.
%K A288386 nonn,tabl
%O A288386 0,4
%A A288386 _Alois P. Heinz_, Jun 08 2017