OFFSET
0,2
LINKS
R. H. Hardin and Harvey P. Dale, Table of n, a(n) for n = 0..1000 (terms n=4..500 from R. H. Hardin)
Index entries for linear recurrences with constant coefficients, signature (1,1,0,1,-1).
FORMULA
G.f.: -(x+1)*(x^2+1)*(x^4-x^3-1)/(x^5-x^4-x^2-x+1). - R. J. Mathar, Jan 19 2011
EXAMPLE
From Tom Edgar, Feb 10 2015: (Start)
When n=4, there are 16 binary strings of length 4 and 3 of them are the ones to avoid, so a(4) = 13.
When n=5, there are 32 binary strings of length 5; the ones including a substring of the indicated form are '00000', '10000', '00001', '00011', '10011', '00110', '00111', 01001', '11001', and '10010'. Since there are 10 to avoid, we have a(5) = 22.
(End)
MATHEMATICA
Join[{1, 2, 4}, LinearRecurrence[{1, 1, 0, 1, -1}, {8, 13, 22, 37, 62}, 40]] (* Harvey P. Dale, Feb 10 2015 *)
CROSSREFS
KEYWORD
nonn
AUTHOR
R. H. Hardin, Aug 14 2009
EXTENSIONS
Offset changed, terms prepended accordingly, and b-file amended by Harvey P. Dale, Feb 11 2015
STATUS
approved