login
A213286
Number of 7-length words w over n-ary alphabet such that for every prefix z of w we have #(z,a_i) = 0 or #(z,a_i) >= #(z,a_j) for all j>i and #(z,a_i) counts the occurrences of the i-th letter in z.
2
0, 1, 46, 367, 1805, 7280, 25781, 83916, 250062, 676155, 1662160, 3748261, 7839811, 15370082, 28505855, 50400890, 85502316, 139914981, 221828802, 342014155, 514390345, 756672196, 1091099801, 1545256472, 2152979930, 2955371775, 4001910276, 5351671521
OFFSET
0,3
LINKS
FORMULA
a(n) = n*(11954-29577*n+27640*n^2-12831*n^3+3234*n^4-420*n^5+24*n^6)/24.
G.f.: x*(1+38*x+27*x^2+101*x^3+610*x^4+693*x^5+3570*x^6)/(1-x)^8.
EXAMPLE
a(0) = 0: no word of length 7 is possible for an empty alphabet.
a(1) = 1: aaaaaaa for alphabet {a}.
a(2) = 46: aaaaaaa, aaaaaab, aaaaaba, aaaaabb, aaaabaa, aaaabab, aaaabba, aaaabbb, aaabaaa, aaabaab, aaababa, aaababb, aaabbaa, aaabbab, aaabbba, aabaaaa, aabaaab, aabaaba, aabaabb, aababaa, aababab, aababba, aabbaaa, aabbaab, aabbaba, abaaaaa, abaaaab, abaaaba, abaaabb, abaabaa, abaabab, abaabba, ababaaa, ababaab, abababa, baaaaaa, baaaaab, baaaaba, baaaabb, baaabaa, baaabab, baaabba, baabaaa, baabaab, baababa, bbbbbbb for alphabet {a,b}.
MAPLE
a:= n-> n*(11954+ (-29577 +(27640 +(-12831+(3234+(-420+24*n)*n) *n) *n) *n) *n)/24:
seq(a(n), n=0..40);
CROSSREFS
Row n=7 of A213276.
Sequence in context: A296402 A077734 A272184 * A135735 A160285 A111304
KEYWORD
nonn,easy
AUTHOR
Alois P. Heinz, Jun 08 2012
STATUS
approved