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.

A026780 Triangular array T read by rows: T(n,0)=T(n,n)=1 for n >= 0; for n >= 2 and 1 <= k <= n-1, T(n,k) = T(n-1,k-1) + T(n-2,k-1) + T(n-1,k) if 1 <= k <= floor(n/2), else T(n,k) = T(n-1,k-1) + T(n-1,k).

This page as a plain text file.
%I A026780 #39 Apr 19 2020 07:39:54
%S A026780 1,1,1,1,3,1,1,5,4,1,1,7,12,5,1,1,9,24,17,6,1,1,11,40,53,23,7,1,1,13,
%T A026780 60,117,76,30,8,1,1,15,84,217,246,106,38,9,1,1,17,112,361,580,352,144,
%U A026780 47,10,1,1,19,144,557,1158,1178,496,191,57,11,1
%N A026780 Triangular array T read by rows: T(n,0)=T(n,n)=1 for n >= 0; for n >= 2 and 1 <= k <= n-1, T(n,k) = T(n-1,k-1) + T(n-2,k-1) + T(n-1,k) if 1 <= k <= floor(n/2), else T(n,k) = T(n-1,k-1) + T(n-1,k).
%C A026780 T(n,k) is the number of paths from (0,0) to (k,n-k) in the directed graph having vertices (i,j) and edges (i,j)-to-(i+1,j) and (i,j)-to-(i,j+1) for i,j>= 0 and edges (i,i+h)-to-(i+1,i+h+1) for i>=0, h>=0.
%C A026780 Also, square array R read by antidiagonals with R(i,j) = T(i+j,i) equal number of paths from (0,0) to (i,j). - _Max Alekseyev_, Jan 13 2015
%H A026780 G. C. Greubel, <a href="/A026780/b026780.txt">Rows n = 0..100 of triangle, flattened</a>
%H A026780 M. A. Alekseyev, <a href="https://arxiv.org/abs/1601.06158">On Enumeration of Dyck-Schroeder Paths</a>, Journal of Combinatorial Mathematics and Combinatorial Computing 106 (2018), 59-68; arXiv:1601.06158 [math.CO], 2016-2018.
%F A026780 For n>=2*k, T(n,k) = coefficient of x^k in F(x)*S(x)^(n-2*k). For n<=2*k, T(n,k) = coefficient of x^(n-k) in F(x)*C(x)^(2*k-n). Here C(x) = (1 - sqrt(1-4x))/(2*x) is o.g.f. for A000108, S(x) = (1 - x - sqrt(1-6*x+x^2))/(2*x) is o.g.f. for A006318, and F(x) = S(x)/(1 - x*C(x)*S(x)) is o.g.f. for A026781. - _Max Alekseyev_, Jan 13 2015
%e A026780 The array T(n,k) starts with:
%e A026780 n=0: 1;
%e A026780 n=1: 1,  1;
%e A026780 n=2: 1,  3,  1;
%e A026780 n=3: 1,  5,  4,  1;
%e A026780 n=4: 1,  7, 12,  5,  1;
%e A026780 n=5: 1,  9, 24, 17,  6, 1;
%e A026780 n=6: 1, 11, 40, 53, 23, 7, 1;
%e A026780 ...
%p A026780 T:= proc(n,k) option remember;
%p A026780     if n<0 then 0;
%p A026780     elif k=0 or k =n then 1;
%p A026780     elif k <= n/2 then
%p A026780         procname(n-1,k-1)+procname(n-2,k-1)+procname(n-1,k) ;
%p A026780     else
%p A026780         procname(n-1,k-1)+procname(n-1,k) ;
%p A026780     fi ;
%p A026780 end proc:
%p A026780 seq(seq(T(n,k), k=0..n), n=0..12); # _G. C. Greubel_, Nov 01 2019
%t A026780 T[n_, k_]:= T[n, k]= If[n<0, 0, If[k==0 || k==n, 1, If[k<=n/2, T[n-1, k-1] + T[n-2, k-1] + T[n-1, k], T[n-1, k-1] + T[n-1, k] ]]];
%t A026780 Table[T[n, k], {n, 0, 10}, {k, 0, n}]//Flatten (* _G. C. Greubel_, Nov 01 2019 *)
%o A026780 (PARI) T(n,k) = if(n<0, 0, if(k==0 || k==n, 1, if( k<=n/2, T(n-1,k-1) + T(n-2,k-1) + T(n-1,k), T(n-1,k-1) + T(n-1,k) ));)
%o A026780 for(n=0,12, for(k=0,n, print1(T(n,k), ", "))) \\ _G. C. Greubel_, Oct 31 2019
%o A026780 (Sage)
%o A026780 @CachedFunction
%o A026780 def T(n, k):
%o A026780     if (n<0): return 0
%o A026780     elif (k==0 or k==n): return 1
%o A026780     elif (k<=n/2): return T(n-1,k-1) + T(n-2,k-1) + T(n-1,k)
%o A026780     else: return T(n-1,k-1) + T(n-1,k)
%o A026780 [[T(n, k) for k in (0..n)] for n in (0..12)] # _G. C. Greubel_, Oct 31 2019
%o A026780 (GAP)
%o A026780 T:= function(n,k)
%o A026780     if n<0 then return 0;
%o A026780     elif k=0 or k=n then return 1;
%o A026780     elif (k <= Int(n/2)) then return T(n-1,k-1)+T(n-2,k-1) +T(n-1,k);
%o A026780     else return T(n-1,k-1) + T(n-1,k);
%o A026780     fi;
%o A026780   end;
%o A026780 Flat(List([0..12], n-> List([0..n], k-> T(n,k) ))); # _G. C. Greubel_, Oct 31 2019
%Y A026780 Cf. A026787 (row sums),  A026781 (center elements), A249488 (row-reversed version).
%Y A026780 Cf. A026782, A026783, A026784, A026785, A026786, A026787, A026788, A026789, A026790.
%K A026780 nonn,tabl
%O A026780 0,5
%A A026780 _Clark Kimberling_
%E A026780 Edited by _Max Alekseyev_, Dec 02 2015