login
A209241
3^n times the expected value of the longest run of 0's in all length n words on {0,1,2}.
1
0, 1, 6, 25, 92, 317, 1054, 3425, 10964, 34729, 109162, 341125, 1061132, 3288713, 10161666, 31318201, 96312696, 295632805, 905955146, 2772234385, 8472129040, 25861509393, 78861419302, 240252829461, 731313754312, 2224352781697
OFFSET
0,3
COMMENTS
a(n) is also the sum of length n words on {0,1,2} that have no runs of 0's of length >= i for i >= 1. In other words, A000079 + A028859 + A119826 + A209239 + ...
REFERENCES
R. Sedgewick and P. Flajolet, Analysis of Algorithms, Addison and Wesley, 1996, Chapter 7.
LINKS
FORMULA
O.g.f.: Sum_{k=1..n} 1/(1-3x)-(1-x^k)/(1-3x+2x^(k+1)).
a(n) = Sum_{k=1..n} A209240(n,k)*k.
EXAMPLE
a(2) = 6 because for such length 2 words: 00, 01, 02, 10, 11, 12, 20, 21, 22 we have respectively longest zero runs of length 2 + 1 + 1 + 1 + 0 + 0 + 1 + 0 + 0 = 6.
MATHEMATICA
nn=25; CoefficientList[Series[Sum[1/(1-3x)-(1-x^k)/(1-3x+2x^(k+1)), {k, 1, nn}], {x, 0, nn}], x]
CROSSREFS
Cf. A119706.
Sequence in context: A333017 A277973 A143815 * A369360 A092491 A112308
KEYWORD
nonn
AUTHOR
Geoffrey Critzer, Jan 13 2013
STATUS
approved