OFFSET
0,3
LINKS
Alois P. Heinz, Table of n, a(n) for n = 0..1000
Index entries for linear recurrences with constant coefficients, signature (6,-15,20,-15,6,-1).
FORMULA
a(n) = n*(94-204*n+155*n^2-45*n^3+6*n^4)/6.
G.f.: x*(1+8*x+5*x^2+22*x^3+84*x^4)/(1-x)^6.
EXAMPLE
a(0) = 0: no word of length 5 is possible for an empty alphabet.
a(1) = 1: aaaaa for alphabet {a}.
a(2) = 14: aaaaa, aaaab, aaaba, aaabb, aabaa, aabab, aabba, abaaa, abaab, ababa, baaaa, baaab, baaba, bbbbb for alphabet {a,b}.
MAPLE
a:= n-> n*(94+(-204+(155+(-45+6*n)*n)*n)*n)/6:
seq(a(n), n=0..40);
CROSSREFS
KEYWORD
nonn,easy
AUTHOR
Alois P. Heinz, Jun 08 2012
STATUS
approved