OFFSET
0,5
LINKS
Index entries for linear recurrences with constant coefficients, signature (9,-30,44,-24).
FORMULA
a(n) = 3^n - (2^(n-3))*(n^2 + 3*n + 8).
E.g.f: exp(2x)*(exp(x)-x^2/2-x-1).
G.f.: x^3/((1 - 2*x)^3*(1 - 3*x)). - Stefano Spezia, Jul 01 2021
EXAMPLE
a(5)=51 since the strings are the 10 permutations of 11000, the 10 permutations of 22000, the 20 permutations of 12000, the 5 permutations of 10000, the 5 permutations of 20000, and 00000.
CROSSREFS
KEYWORD
nonn,easy
AUTHOR
Enrique Navarrete, Jun 29 2021
STATUS
approved