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.
%I A119808 #10 Nov 19 2012 19:22:29 %S A119808 1,2,1,4,5,8,17,2,16,49,16,32,129,78,4,64,321,300,44,128,769,1002,280, %T A119808 8,256,1793,3048,1352,112,512,4097,8678,5500,880,16,1024,9217,23524, %U A119808 19892,5120,272,2048,20481,61410,66032,24600,2544,32,4096,45057,155616,205360 %N A119808 Triangle read by rows: T(n,k) is the number of ternary words of length n having k runs of consecutive 0's (0<=k<=ceiling(n/2)). %C A119808 Row n contains 1+ceiling(n/2) terms. T(n,0) = 2^n (A000079). T(n,1) = 1+(n-1)*2^n = A000337(n) for n>=1. T(n,2) = 2*A055581(n-3) (n>=3). Sum(k*T(n,k),k>=0) = A081038(n-1). %H A119808 Alois P. Heinz, <a href="/A119808/b119808.txt">Rows n = 0..200, flattened</a> %F A119808 G.f.: (1-z+tz)/(1-3z+2z^2-2tz^2). G.f. of column k: 2^(k-1)*z^(2k-1)*/ [(1-z)^k*(1-2z)^(k+1)] (k>=1). Recurrence relation: T(n,k) = 3T(n-1,k) -2T(n-2,k) +2T(n-2,k-1) for n>=2. %e A119808 T(2,1) = 5 because we have 00, 01, 02, 10 and 20. %e A119808 Triangle starts: %e A119808 1; %e A119808 2,1; %e A119808 4,5; %e A119808 8,17,2; %e A119808 16,49,16; %e A119808 32,129,78,4; %p A119808 G:=(1-z+t*z)/(1-3*z+2*z^2-2*t*z^2): Gser:=simplify(series(G,z=0,15)): P[0]:=1: for n from 1 to 12 do P[n]:=sort(coeff(Gser,z^n)) od: for n from 0 to 12 do seq(coeff(P[n],t,j),j=0..ceil(n/2)) od; # yields sequence in triangular form %t A119808 nn=15;f[list_]:=Select[list,#>0&]; a = y x/(1-x) +1;Map[f,CoefficientList[ Series[a/(1-2x a),{x,0,nn}],{x,y}]]//Grid (* _Geoffrey Critzer_, Nov 19 2012 *) %Y A119808 Cf. A000079, A000337, A055581, A081038, A034839. %K A119808 nonn,tabf %O A119808 0,2 %A A119808 _Emeric Deutsch_, May 25 2006