OFFSET
0,3
REFERENCES
Thomas A. Sudkamp, An Introduction to Languages and Machines. second edition 1997 Addison-Wesley.
LINKS
Brallan S. Rueda Mantilla, Automata, regular expression and recurrence law for a(n)
Index entries for linear recurrences with constant coefficients, signature (0,6,9).
FORMULA
a(n) = 3^(n-1) + (1/3)*(-3/2 + sqrt(3)*i/2)^n + (1/3)*(-3/2 - sqrt(3)*i/2)^n.
a(n) = 6*a(n-2) + 9*a(n-3).
G.f.: (1 - 2*x^2)/((1 - 3*x)*(1 + 3*x + 3*x^2)). - Andrew Howroyd, Sep 11 2020
E.g.f.: (exp(3*x) + 2*exp(-3*x/2)*cos(sqrt(3)*x/2))/3. - Stefano Spezia, Sep 11 2020
EXAMPLE
The a(3)=9 words are (0,0,0), (0,0,1), (0,1,0), (0,1,1), (1,0,0), (1,0,1), (1,1,0), (1,1,1), (2,2,2).
MATHEMATICA
CoefficientList[Series[(1 - 2 x^2)/((1 - 3 x) (1 + 3 x + 3 x^2)), {x, 0, 28}], x] (* Michael De Vlieger, Sep 11 2020 *)
LinearRecurrence[{0, 6, 9}, {1, 0, 4}, 30] (* Harvey P. Dale, Aug 10 2023 *)
PROG
(PARI) Vec((1 - 2*x^2)/((1 - 3*x)*(1 + 3*x + 3*x^2)) + O(x^30)) \\ Andrew Howroyd, Sep 11 2020
CROSSREFS
KEYWORD
nonn,easy
AUTHOR
Brallan S. Rueda Mantilla, Sep 10 2020
STATUS
approved