OFFSET
0,2
COMMENTS
a(n) is the number of length n words on the alphabet {a,b,c,d,e} such that each word contains at least two a's or zero or at least two b's.
LINKS
Index entries for linear recurrences with constant coefficients, signature (14,-72,162,-135).
FORMULA
a(n) = 5^n - n*(n+2)*3^(n-2).
a(n) = 14*a(n-1) - 72*a(n-2) + 162*a(n-3) - 135*a(n-4).
G.f.: (1 - 10*x + 33*x^2 - 32*x^3)/((1 - 5*x)*(1 - 3*x)^3).
a(n) = 5^n - A383136(n).
EXAMPLE
a(1) = 4 since the words are a, c, d, e.
a(2) = 17 since the words are aa, bb, cc, dd, ee, and the following, with 2 permutations each: ac, ad, ae, cd, ce, de.
MATHEMATICA
LinearRecurrence[{14, -72, 162, -135}, {1, 4, 17, 80}, 25] (* Stefano Spezia, Dec 09 2025 *)
CROSSREFS
KEYWORD
nonn,easy
AUTHOR
Enrique Navarrete, Dec 02 2025
STATUS
approved
