|
|
A334656
|
|
a(n) is the number of words of length n on the alphabet {0,1,2} with the number of 0's plus the number of 1's congruent to the number of 2's modulo 3.
|
|
1
|
|
|
1, 0, 4, 9, 24, 90, 225, 756, 2160, 6561, 19764, 58806, 177633, 530712, 1595052, 4782969, 14346720, 43053282, 129127041, 387440172, 1162241784, 3486784401, 10460412252, 31380882462, 94143533121, 282429005040, 847289140884, 2541865828329, 7625595890664
(list;
graph;
refs;
listen;
history;
text;
internal format)
|
|
|
OFFSET
|
0,3
|
|
REFERENCES
|
Thomas A. Sudkamp, An Introduction to Languages and Machines. second edition 1997 Addison-Wesley.
|
|
LINKS
|
|
|
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
|
|
|
STATUS
|
approved
|
|
|
|