OFFSET
0,3
COMMENTS
REFERENCES
R. Sedgewick and P. Flajolet, Analysis of Algorithms, Addison and Wesley, 1996, Chapter 7.
LINKS
G. C. Greubel, Table of n, a(n) for n = 0..1000
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
KEYWORD
nonn
AUTHOR
Geoffrey Critzer, Jan 13 2013
STATUS
approved