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 A119825 #13 Jan 02 2021 19:13:31 %S A119825 1,3,9,26,1,76,4,1,222,16,4,1,648,60,16,4,1,1892,212,62,16,4,1,5524, %T A119825 728,224,64,16,4,1,16128,2444,788,236,66,16,4,1,47088,8064,2712,848, %U A119825 248,68,16,4,1,137480,26256,9168,2984,908,260,70,16,4,1,401392,84576,30576 %N A119825 Triangle read by rows: T(n,k) is the number of ternary sequences of length n containing k subsequences 000 (consecutively; n,k>=0). %C A119825 Rows 0 and 1 have one term each; row n (n>=2) have n-1 terms. Sum of entries in row n is 3^n (A000244). T(n,0) = A119826(n) T(n,1) = A119827(n) Sum(k*T(n,k), k>=0)=(n-2)*3^(n-3) = A027741(n-1). %H A119825 Alois P. Heinz, <a href="/A119825/b119825.txt">Rows n = 0..150, flattened</a> %F A119825 G.f.: G(t,z)=[1+(1-t)z+(1-t)z^2]/[1-(2+t)z-2(1-t)z^2-2(1-t)z^3]. %e A119825 T(5,2) = 4 because we have 00001, 00002, 10000 and 20000. %e A119825 Triangle starts: %e A119825 1; %e A119825 3; %e A119825 9; %e A119825 26, 1; %e A119825 76, 4, 1; %e A119825 222, 16, 4, 1; %e A119825 ... %p A119825 G:=(1+(1-t)*z+(1-t)*z^2)/(1-(2+t)*z-2*(1-t)*z^2-2*(1-t)*z^3): 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: 1;3;for n from 2 to 12 do seq(coeff(P[n],t,j),j=0..n-2) od; # yields sequence in triangular form %t A119825 nn=10; f[list_]:=Select[list,#>0&]; a=x^2/(1-y x) +x; Map[f,CoefficientList[Series[(a+1)/(1-2x-2x a),{x,0,nn}],{x,y}]]//Grid (* _Geoffrey Critzer_, Oct 31 2012 *) %Y A119825 Cf. A000244, A119826, A119827, A027741. %K A119825 nonn,tabf %O A119825 0,2 %A A119825 _Emeric Deutsch_, May 26 2006