cp's OEIS Frontend

This is a front-end for the Online Encyclopedia of Integer Sequences, made by Christian Perfect. The idea is to provide OEIS entries in non-ancient HTML, and then to think about how they're presented visually. The source code is on GitHub.

User: Félix Balado

Félix Balado's wiki page.

Félix Balado has authored 7 sequences.

A386250 Total number of ones in runs of 1's of length >= 4 over all binary strings of length n.

Original entry on oeis.org

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

Author

Félix Balado, Aug 14 2025

Keywords

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.
		

Crossrefs

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

A386270 Total number of ones in runs of 1s of length <=2 over all binary strings of length n.

Original entry on oeis.org

0, 1, 4, 9, 22, 52, 120, 272, 608, 1344, 2944, 6400, 13824, 29696, 63488, 135168, 286720, 606208, 1277952, 2686976, 5636096, 11796480, 24641536, 51380224, 106954752, 222298112, 461373440, 956301312, 1979711488, 4093640704, 8455716864, 17448304640, 35970351104
Offset: 0

Author

Félix Balado, Aug 14 2025

Keywords

Examples

			For n=4, the binary strings that contain runs of 1s of length <=2 are: 0001, 0010, 0011, 0100, 0101, 0110, 1000, 1001, 1010, 1011, 1100, and 1101. The total number of ones in the runs of 1s of length <=2 is thus a(4)=22.
		

Crossrefs

Formula

a(n) = n*2^(n-1) for n<3 and a(n) = (6+4*n)*2^(n-4) for n>=3.

A386878 Number of runs of 1's of length <= 3 over all binary strings of length n.

Original entry on oeis.org

0, 1, 3, 8, 19, 45, 104, 236, 528, 1168, 2560, 5568, 12032, 25856, 55296, 117760, 249856, 528384, 1114112, 2342912, 4915200, 10289152, 21495808, 44826624, 93323264, 193986560, 402653184, 834666496, 1728053248, 3573547008, 7381975040, 15233712128, 31406948352
Offset: 0

Author

Félix Balado, Aug 06 2025

Keywords

Examples

			For n=3, the breakdown of the 8 runs of 1s is as follows: 001 (1), 010 (1), 011 (1), 100 (1), 101 (2), 110 (1) and 111 (1).
For n=4, the breakdown of the 19 runs of 1s is as follows: 0001 (1), 0010 (1), 0011 (1), 0100 (1), 0101 (2), 0110 (1), 0111 (1), 1000 (1), 1001 (2), 1010 (2), 1011 (2), 1100 (1), 1101 (2) and 1110 (1).
		

Crossrefs

Programs

  • Mathematica
    LinearRecurrence[{4, -4}, {0, 1, 3, 8, 19, 45}, 40] (* Paolo Xausa, Aug 19 2025 *)
  • Python
    def A386878(n): return (0,1,3,8,19)[n] if n<5 else 3+7*(n+1)<Chai Wah Wu, Aug 19 2025

Formula

For n>=4, a(n)=(3+7*(n+1))*2^(n-5); for n<4, a(n)=(n+1)*2^(n-2).
G.f.: x*(x^2+x+1)*(x-1)^2/(2*x-1)^2. - Alois P. Heinz, Aug 14 2025

A384497 a(n) is the number of binary strings of length n which contain exactly one run of 1s of even length.

Original entry on oeis.org

0, 0, 1, 2, 6, 12, 28, 56, 119, 236, 479, 940, 1859, 3612, 7028, 13538, 26051, 49820, 95098, 180774, 342944, 648648, 1224517, 2306338, 4336449, 8138516, 15250965, 28535528, 53320792, 99504804, 185474501, 345332950, 642310142, 1193510160, 2215702468, 4109801864
Offset: 0

Author

Félix Balado, May 31 2025

Keywords

Examples

			a(3)=2 because of the strings 011 and 110.
		

Crossrefs

Cf. A029907.

Programs

  • Mathematica
    CoefficientList[Series[((1 - x^2) * x^2)/(1 - x - 2 * x^2 + x^3)^2,{x,0,35}],x] (* Stefano Spezia, Jun 02 2025 *)

Formula

G.f.: ((1 - x^2) * x^2)/(1 - x - 2 * x^2 + x^3)^2.

A384155 a(n) is the number of binary strings of length n whose shortest run of 1s is of length 3.

Original entry on oeis.org

0, 0, 0, 1, 2, 3, 4, 6, 11, 21, 38, 65, 108, 179, 299, 502, 842, 1406, 2337, 3872, 6403, 10575, 17445, 28742, 47293, 77720, 127578, 209210, 342768, 561131, 917910, 1500476, 2451158, 4001723, 6529439, 10648199, 17356589, 28278426
Offset: 0

Author

Félix Balado, May 31 2025

Keywords

Crossrefs

Programs

  • Mathematica
    LinearRecurrence[{4, -6, 4, 0, -1, -1, 1, 0, -1}, {0, 0, 0, 1, 2, 3, 4, 6, 11}, 50] (* Amiram Eldar, May 31 2025 *)

Formula

G.f.: x^3 * (1 - x)^2/(((1 - x)^2 - x^4) * ((1 - x)^2 - x^5)).

A384153 a(n) is the number of binary strings of length n whose shortest run of 1s is of length 1.

Original entry on oeis.org

0, 1, 2, 4, 9, 20, 43, 91, 191, 398, 824, 1697, 3480, 7111, 14487, 29439, 59694, 120820, 244153, 492716, 993171, 1999923, 4023679, 8089182, 16251760, 32632321, 65490672, 131377999, 263452079, 528125695, 1058395038, 2120551916, 4247705401, 8506995748, 17034321659
Offset: 0

Author

Félix Balado, May 20 2025

Keywords

Crossrefs

Formula

G.f.: 1/(1-2*x) - (1-x)/(x*(1-2*x+x^2-x^3)).

A384154 a(n) is the number of binary strings of length n whose shortest run of 1s is of length 2.

Original entry on oeis.org

0, 0, 1, 2, 3, 5, 10, 20, 38, 70, 128, 234, 427, 776, 1404, 2531, 4550, 8161, 14608, 26099, 46550, 82901, 147441, 261913, 464759, 823902, 1459287, 2582615, 4567357, 8072082, 14257631, 25169443, 44410452, 78325112, 138082349, 243339192, 428683436, 754961473
Offset: 0

Author

Félix Balado, May 20 2025

Keywords

Crossrefs

Programs

  • Mathematica
    LinearRecurrence[{4,-6,5,-2,-1,1,-1},{0,0,1,2,3,5,10},40] (* Harvey P. Dale, Jun 24 2025 *)

Formula

G.f.: x^2 * (1 - x)^2/(((1 - x)^2 - x^3) * ((1 - x)^2 - x^4)).