A120909 Triangle read by rows: T(n,k) is the number of ternary words of length n having k runs (i.e., subwords of maximal length) of identical letters (1 <= k <= n).
3, 3, 6, 3, 12, 12, 3, 18, 36, 24, 3, 24, 72, 96, 48, 3, 30, 120, 240, 240, 96, 3, 36, 180, 480, 720, 576, 192, 3, 42, 252, 840, 1680, 2016, 1344, 384, 3, 48, 336, 1344, 3360, 5376, 5376, 3072, 768, 3, 54, 432, 2016, 6048, 12096, 16128, 13824, 6912, 1536, 3, 60
Offset: 1
Examples
T(3,2)=12 because we have 001,002,011,022,100,110,112,122,200,211,220 and 221. Triangle starts: 3; 3, 6; 3, 12, 12; 3, 18, 36, 24; 3, 24, 72, 96, 48;
Programs
-
Maple
T:=(n,k)->3*2^(k-1)*binomial(n-1,k-1): for n from 1 to 11 do seq(T(n,k),k=1..n) od; # yields sequence in triangular form
-
Mathematica
nn=15;f[list_]:=Select[list,#>0&];a=y x/(1-x) +1;b=a^2/(1-(a-1)^2 );Drop[Map[f,CoefficientList[Series[b a/(1-(a-1)(b-1)),{x,0,nn}],{x,y}]],1]//Grid (* Geoffrey Critzer, Nov 20 2012 *)
Comments