login
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

%I #45 Jul 14 2022 22:48:38

%S 0,1,4,13,40,41,172,85,464,145,980,221,1784,313,2940,421,4512,545,

%T 6564,685,9160,841,12364,1013,16240,1201,20852,1405,26264,1625,32540,

%U 1861,39744,2113,47940,2381,57192,2665,67564,2965,79120,3281,91924,3613,106040,3961,121532,4325,138464,4705,156900

%N 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.

%D Rodrigo De Castro, Teoria de la computaciĆ³n [Computer Theory], book published by National University of Colombia [date?].

%H <a href="/index/Rec#order_08">Index entries for linear recurrences with constant coefficients</a>, signature (0,4,0,-6,0,4,0,-1).

%F a(n) = (14/3)*n - 4*n^2 + (4/3)*n^3 if n is even;

%F a(n) = 1 - 2*n + 2*n^2 if n is odd.

%F From _Chai Wah Wu_, Mar 04 2021: (Start)

%F a(n) = 4*a(n-2) - 6*a(n-4) + 4*a(n-6) - a(n-8) for n > 7.

%F 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)

%K nonn,easy

%O 0,3

%A _Marlon Vanegas_, Mar 02 2021