OFFSET
3,1
COMMENTS
If the offsets are modified, A124810 to A124813 are the 2nd to 5th Witt transform of A000244 [Moree]. - R. J. Mathar, Nov 08 2008
LINKS
Pieter Moree, The formal series Witt transform, Discr. Math. no. 295 vol. 1-3 (2005) 143-160. [From R. J. Mathar, Nov 08 2008]
Index entries for linear recurrences with constant coefficients, signature (6, -6, -18, 27).
FORMULA
O.g.f.: 3 x^3 (1-2 x)/((1-3x)^2 (1-3x^2)) = 1/2*((x/(1-3*x))^2 - x^2/(1-3*x^2)) a(n) = 1/2*sum_{d|2,d|n} mu(d) C(n/d-1,(n-2)/d )*3^((n-2)/d) =1/2*(n-1)*3^(n-2) if n is odd =1/2*(n-1)*3^(n-2) - 1/2*3^((n-2)/2) if n is even.
EXAMPLE
a(4) = 12 because 1122, 1123, 1124, 1132, 1133, 1134, 1142, 1143, 1144, 1213, 1214, 1314 are all 4-ary Lyndon words with length 4 and have exactly two 1s.
MAPLE
a:= n-> (Matrix([[12, 3, 0, 0]]). Matrix(4, (i, j)-> if (i=j-1) then 1 elif j=1 then [6, -6, -18, 27][i] else 0 fi)^(n-4))[1, 1]: seq(a(n), n=3..26); # Alois P. Heinz, Aug 04 2008
MATHEMATICA
a[n_] := (1/2)*(n-1)*3^(n-2) - If[OddQ[n], 0, (1/2)*3^((n-2)/2)];
Array[a, 24, 3] (* Jean-François Alcover, Sep 19 2017 *)
CROSSREFS
KEYWORD
nonn
AUTHOR
Mike Zabrocki, Nov 08 2006
STATUS
approved