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.

A332052 Number of binary words of length n with an even number of occurrences of the subword 0101.

Original entry on oeis.org

1, 2, 4, 8, 15, 28, 54, 104, 198, 380, 736, 1424, 2756, 5360, 10456, 20416, 39944, 78352, 153952, 302912, 596976, 1178304, 2328544, 4606848, 9124448, 18089920, 35895552, 71283968, 141664832, 281718528, 560561024, 1115994112, 2222846080, 4429381888, 8829667840
Offset: 0

Views

Author

Alois P. Heinz, Feb 06 2020

Keywords

Examples

			a(4) = 15 = 2^4 - 1: 0101 is not counted.
a(5) = 28 = 2^5 - 4: 00101, 10101, 01010, 01011 are not counted.
		

Crossrefs

Programs

  • Maple
    a:= n-> 2^n-(<<0|1|0|0|0>, <0|0|1|0|0>, <0|0|0|1|0>
                , <0|0|0|0|1>, <4|-10|8|-6|4>>^n)[1, 5]:
    seq(a(n), n=0..39);
  • Mathematica
    LinearRecurrence[{4,-6,8,-10,4},{1,2,4,8,15},50] (* Harvey P. Dale, Mar 07 2024 *)

Formula

G.f.: (x^4-4*x^3+2*x^2-2*x+1)/((1-2*x)*(2*x^4-4*x^3+2*x^2-2*x+1)).
a(n) = Sum_{k>=0} A118869(n,2*k).