login
A342159
Number of words of length n, over the alphabet {a,b,c}, which have an odd number of a's and the number of b's plus the number of c's is less than or equal to 3.
0
0, 1, 4, 13, 40, 41, 172, 85, 464, 145, 980, 221, 1784, 313, 2940, 421, 4512, 545, 6564, 685, 9160, 841, 12364, 1013, 16240, 1201, 20852, 1405, 26264, 1625, 32540, 1861, 39744, 2113, 47940, 2381, 57192, 2665, 67564, 2965, 79120, 3281, 91924, 3613, 106040, 3961, 121532, 4325, 138464, 4705, 156900
OFFSET
0,3
REFERENCES
Rodrigo De Castro, Teoria de la computación [Computer Theory], book published by National University of Colombia [date?].
FORMULA
a(n) = (14/3)*n - 4*n^2 + (4/3)*n^3 if n is even;
a(n) = 1 - 2*n + 2*n^2 if n is odd.
From Chai Wah Wu, Mar 04 2021: (Start)
a(n) = 4*a(n-2) - 6*a(n-4) + 4*a(n-6) - a(n-8) for n > 7.
G.f.: x*(-x^3 + 7*x^2 + x + 1)*(5*x^3 - x^2 + 3*x + 1)/((x - 1)^4*(x + 1)^4). (End)
CROSSREFS
Sequence in context: A000746 A271012 A272581 * A191132 A360606 A119915
KEYWORD
nonn,easy
AUTHOR
Marlon Vanegas, Mar 02 2021
STATUS
approved