login

Year-end appeal: Please make a donation to the OEIS Foundation to support ongoing development and maintenance of the OEIS. We are now in our 61st year, we have over 378,000 sequences, and we’ve reached 11,000 citations (which often say “discovered thanks to the OEIS”).

A213284
Number of 5-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, 14, 74, 276, 895, 2506, 6104, 13224, 26061, 47590, 81686, 133244, 208299, 314146, 459460, 654416, 910809, 1242174, 1663906, 2193380, 2850071, 3655674, 4634224, 5812216, 7218725, 8885526, 10847214, 13141324, 15808451, 18892370, 22440156, 26502304
OFFSET
0,3
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
Row n=5 of A213276.
Sequence in context: A279447 A205590 A369244 * A232377 A146563 A205583
KEYWORD
nonn,easy
AUTHOR
Alois P. Heinz, Jun 08 2012
STATUS
approved