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.

A055794 Triangle T read by rows: T(i,0)=1 for i >= 0; T(i,i)=1 for i=0,1,2,3; T(i,i)=0 for i >= 4; T(i,j) = T(i-1,j) + T(i-2,j-1) for 1<=j<=i-1.

This page as a plain text file.
%I A055794 #25 Jan 05 2025 19:51:36
%S A055794 1,1,1,1,2,1,1,3,2,1,1,4,4,2,0,1,5,7,4,1,0,1,6,11,8,3,0,0,1,7,16,15,7,
%T A055794 1,0,0,1,8,22,26,15,4,0,0,0,1,9,29,42,30,11,1,0,0,0,1,10,37,64,56,26,
%U A055794 5,0,0,0,0,1,11,46,93,98,56,16,1,0,0,0,0,1,12,56,130,162,112,42,6,0,0,0,0,0
%N A055794 Triangle T read by rows: T(i,0)=1 for i >= 0; T(i,i)=1 for i=0,1,2,3; T(i,i)=0 for i >= 4; T(i,j) = T(i-1,j) + T(i-2,j-1) for 1<=j<=i-1.
%C A055794 T(i+j,j) is the number of strings (s(1),...,s(i+1)) of nonnegative integers s(k) such that 0<=s(k)-s(k-1)<=1 for k=2,3,...,i+1 and s(i+1)=j.
%C A055794 T(i+j,j) is the number of compositions of j consisting of i parts, all of in {0,1}.
%H A055794 G. C. Greubel, <a href="/A055794/b055794.txt">Rows n = 0..100 of triangle, flattened</a>
%H A055794 Clark Kimberling, <a href="https://web.archive.org/web/2024*/https://www.fq.math.ca/Scanned/40-4/kimberling.pdf">Path-counting and Fibonacci numbers</a>, Fib. Quart. 40 (4) (2002) 328-338, Example 1B.
%e A055794 Triangle begins:
%e A055794   1;
%e A055794   1, 1;
%e A055794   1, 2, 1;
%e A055794   1, 3, 2, 1;
%e A055794   1, 4, 4, 2, 0;
%e A055794   1, 5, 7, 4, 1, 0;
%e A055794   ...
%e A055794 T(7,4) counts the strings 3334, 3344, 3444, 2234, 2334, 2344, 1234.
%e A055794 T(7,4) counts the compositions 001, 010, 100, 011, 101, 110, 111.
%p A055794 T:= proc(n, k) option remember;
%p A055794       if k=0 then 1
%p A055794     elif k=n and n<4 then 1
%p A055794     elif k=n then 0
%p A055794     else T(n-1, k) + T(n-2, k-1)
%p A055794       fi; end:
%p A055794 seq(seq(T(n, k), k=0..n), n=0..12); # _G. C. Greubel_, Jan 25 2020
%t A055794 T[n_, k_]:= T[n, k]= If[k==0, 1, If[k==n && n<4, 1, If[k==n, 0, T[n-1, k] + T[n-2, k-1] ]]]; Table[T[n, k], {n,0,12}, {k,0,n}]//Flatten (* _G. C. Greubel_, Jan 25 2020 *)
%o A055794 (PARI) T(n,k) = if(k==0, 1, if(k==n && n<4, 1, if(k==n, 0, T(n-1, k) + T(n-2, k-1) )));
%o A055794 for(n=0,12, for(k=0,n, print1(T(n,k), ", "))) \\ _G. C. Greubel_, Jan 25 2020
%o A055794 (Magma)
%o A055794 function T(n,k)
%o A055794   if k eq 0 then return 1;
%o A055794   elif k eq n and n lt 4 then return 1;
%o A055794   elif k eq n then return 0;
%o A055794   else return T(n-1,k) + T(n-2, k-1);
%o A055794   end if; return T; end function;
%o A055794 [T(n,k): k in [0..n], n in [0..12]]; // _G. C. Greubel_, Jan 25 2020
%o A055794 (Sage)
%o A055794 @CachedFunction
%o A055794 def T(n, k):
%o A055794     if (k==0): return 1
%o A055794     elif (k==n and n<4): return 1
%o A055794     elif (k==n): return 0
%o A055794     else: return T(n-1, k) + T(n-2, k-1)
%o A055794 [[T(n, k) for k in (0..n)] for n in (0..12)] # _G. C. Greubel_, Jan 25 2020
%o A055794 (GAP)
%o A055794 T:= function(n,k)
%o A055794     if k=0 then return 1;
%o A055794     elif k=n and n<4 then return 1;
%o A055794     elif k=n then return 0;
%o A055794     else return T(n-1,k) + T(n-2,k-1);
%o A055794     fi; end;
%o A055794 Flat(List([0..12], n-> List([0..n], k-> T(n,k) ))); # _G. C. Greubel_, Jan 25 2020
%Y A055794 Row sums: A000204 (Lucas numbers).
%Y A055794 Cf. subsequences T(2n+m,n): A000125 (m=0, cake numbers), A055795 (m=1), A027660 (m=2), A055796 (m=3), A055797 (m=4), A055798 (m=5), A055799 (m=6).
%K A055794 nonn,tabl
%O A055794 0,5
%A A055794 _Clark Kimberling_, May 28 2000
%E A055794 Typo in definition corrected by _Georg Fischer_, Dec 03 2021