OFFSET
0,4
LINKS
Michael De Vlieger, Table of n, a(n) for n = 0..3321
Félix Balado and Guénolé C. M. Silvestre, Systematic Enumeration of Fundamental Quantities Involving Runs in Binary Strings, arXiv:2602.10005 [math.CO], 2026. See p. 38, Sect. 2.8.
Index entries for linear recurrences with constant coefficients, signature (3,0,-5,2).
FORMULA
G.f.: x^2 * (1-x) / ((x^3 - 2*x^2 - x + 1) * (2*x - 1))
a(n) ~ 2^n. - Stefano Spezia, Aug 28 2025
EXAMPLE
a(5) = 13 because there are 13 binary strings of length 5 that contain at least one run of ones of even length: 00011, 00110, 01011, 01100, 01101, 01111, 10011, 10110, 11000, 11001, 11010, 11011, and 11110.
MATHEMATICA
LinearRecurrence[{3, 0, -5, 2}, {0, 0, 1, 2}, 35] (* James C. McMahon, Sep 05 2025 *)
(* Alternative: *)
CoefficientList[Series[-x^2 * (1-x) / ((x^3 - 2*x^2 - x + 1) * (2*x - 1)), {x, 0, 34}], x] (* James C. McMahon, Sep 05 2025 *)
CROSSREFS
KEYWORD
nonn,easy,changed
AUTHOR
Félix Balado, Aug 26 2025
STATUS
approved
