A386250 Total number of ones in runs of 1's of length >= 4 over all binary strings of length n.
0, 0, 0, 0, 4, 13, 36, 92, 224, 528, 1216, 2752, 6144, 13568, 29696, 64512, 139264, 299008, 638976, 1359872, 2883584, 6094848, 12845056, 27000832, 56623104, 118489088, 247463936, 515899392, 1073741824, 2231369728, 4630511616, 9596567552, 19864223744, 41070624768, 84825604096, 175019917312
Offset: 0
Examples
For n=6 there are eight binary strings that contain runs of 1s of length >= 4: 001111, 011110, 011111, 101111, 111100, 111101, 111110 and 111111; the runs of length >= 4 in these strings contain a(6) = 36 ones.
Links
- Index entries for linear recurrences with constant coefficients, signature (4,-4).
Programs
-
Mathematica
LinearRecurrence [{4,-4}, {4,13}, 30] (* Hugo Pfoertner, Aug 14 2025 *)
Formula
For n>=4, a(n) = (5*n-12)*2^(n-5).
G.f.: -x^4*(3*x-4)/(2*x-1)^2. - Alois P. Heinz, Aug 14 2025