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.

A104549 Triangle read by rows: T(n,k) is the number of Schroeder paths of length 2n and having k horizontal segments (a horizontal segment is a maximal string of horizontal steps).

This page as a plain text file.
%I A104549 #18 Jun 02 2025 00:26:59
%S A104549 1,1,1,2,4,5,14,3,14,49,26,1,42,175,154,23,132,637,786,241,10,429,
%T A104549 2353,3728,1831,215,2,1430,8788,16966,11723,2564,115,4862,33098,75249,
%U A104549 67669,22866,2319,35,16796,125476,328012,364864,171310,29869,1386,5
%N A104549 Triangle read by rows: T(n,k) is the number of Schroeder paths of length 2n and having k horizontal segments (a horizontal segment is a maximal string of horizontal steps).
%C A104549 A Schroeder path is a lattice path starting from (0,0), ending at a point on the x-axis, consisting only of steps U=(1,1), D=(1,-1) and H=(2,0) and never going below the x-axis. Schroeder paths are counted by the large Schroeder numbers (A006318).
%H A104549 G. C. Greubel, <a href="/A104549/b104549.txt">Rows n = 0..50 of the triangle, flattened</a>
%F A104549 T(n, 0) = A000108(n).
%F A104549 T(n, k) = Sum_{j=ceiling((k-1)/2)..n-k} binomial(2j, j)*binomial(2j+1, k)*binomial(n-j-1, k-1)/(j+1) for 1 <= k <= round(2n/3).
%F A104549 G.f.: G = G(t, z) satisfies z*(1 - z + t*z)*G^2 - (1-z)*G + 1 - z + t*z = 0.
%e A104549 T(2,1)=4 because we have (HH), (H)UD, UD(H) and U(H)D; the horizontal segments are shown between parentheses.
%e A104549 Triangle starts:
%e A104549      1;
%e A104549      1,     1;
%e A104549      2,     4;
%e A104549      5,    14,     3;
%e A104549     14,    49,    26,     1;
%e A104549     42,   175,   154,    23;
%e A104549    132,   637,   786,   241,    10;
%e A104549    429,  2353,  3728,  1831,   215,    2;
%e A104549   1430,  8788, 16966, 11723,  2564,  115;
%e A104549   4862, 33098, 75249, 67669, 22866, 2319,  35;
%p A104549 T:=proc(n,k) if k=0 then binomial(2*n,n)/(n+1) else sum(binomial(2*j,j)*binomial(2*j+1,k)*binomial(n-j-1,k-1)/(j+1),j=ceil((k-1)/2)..n-k) fi end: for n from 0 to 11 do seq(T(n,k),k=0..round(2*n/3)) od; # yields sequence in triangular form
%t A104549 T[n_, k_]:= T[n, k]= Sum[CatalanNumber[j]*Binomial[2*j+1,k]*Binomial[n -j-1, k-1], {j, Ceiling[(k-1)/2], n-k}];
%t A104549 Table[T[n, k], {n,0,15}, {k, 0, Round[2*n/3]}]//Flatten (* _G. C. Greubel_, Jan 01 2023 *)
%o A104549 (Magma)
%o A104549 function T(n,k)
%o A104549   if k eq 0 then return Catalan(n);
%o A104549   else return (&+[Catalan(j)*Binomial(2*j+1,k)*Binomial(n-j-1,k-1): j in [Ceiling((k-1)/2)..n-k]]);
%o A104549   end if; return T;
%o A104549 end function;
%o A104549 [T(n,k): k in [0..Round(2*n/3)], n in [0..12]]; // _G. C. Greubel_, Jan 01 2023
%o A104549 (SageMath)
%o A104549 @CachedFunction
%o A104549 def T(n,k): # T = A104549
%o A104549     if (k==0): return catalan_number(n)
%o A104549     else: return sum(catalan_number(j)*binomial(2*j+1,k)*binomial(n-j-1,k-1) for j in range(ceil((k-1)/2),n-k+1))
%o A104549 flattan([[T(n,k) for k in range(round(2*n/3)+1)] for n in range(12)]) # _G. C. Greubel_, Jan 01 2023
%Y A104549 Row sums are the large Schroeder numbers (A006318). Column 0 yields the Catalan numbers (A000108).
%Y A104549 Cf. A006318, A000108, A104550.
%K A104549 nonn,tabf
%O A104549 0,4
%A A104549 _Emeric Deutsch_, Mar 14 2005