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 (7,-21,35,-35,21,-7,1).
FORMULA
a(n) = n*(-332+757*n-632*n^2+255*n^3-48*n^4+4*n^5)/4.
G.f.: x*(1+20*x-3*x^2+89*x^3+106*x^4+507*x^5) / (1-x)^7.
EXAMPLE
a(0) = 0: no word of length 6 is possible for an empty alphabet.
a(1) = 1: aaaaaa for alphabet {a}.
a(2) = 27: aaaaaa, aaaaab, aaaaba, aaaabb, aaabaa, aaabab, aaabba, aaabbb, aabaaa, aabaab, aababa, aababb, aabbaa, aabbab, abaaaa, abaaab, abaaba, abaabb, ababaa, ababab, baaaaa, baaaab, baaaba, baaabb, baabaa, baabab, bbbbbb for alphabet {a,b}.
MAPLE
a:= n-> n*(-332+(757+(-632+(255+(-48+4*n)*n)*n)*n)*n)/4:
seq(a(n), n=0..40);
CROSSREFS
KEYWORD
nonn,easy
AUTHOR
Alois P. Heinz, Jun 08 2012
STATUS
approved