login
A390340
Expansion of e.g.f. exp(3*x)*(exp(2*x) - x^2 - x).
0
1, 4, 17, 80, 409, 2180, 11737, 62816, 332305, 1736612, 8978305, 46013456, 234220393, 1186159460, 5984472841, 30111025760, 151210395553, 758304756164, 3799200446065, 19021959403088, 95196966625465, 476275785914564, 2382344768851897, 11914914251986400, 59585062994194609
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.
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
Sequence in context: A089165 A056096 A257084 * A371915 A245377 A351150
KEYWORD
nonn,easy
AUTHOR
Enrique Navarrete, Dec 02 2025
STATUS
approved