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.

A110471 Prime analog of Baum-Sweet sequence: a(n) = 1 if binary representation of n contains no block of consecutive zeros of exactly prime length; otherwise a(n) = 0.

Original entry on oeis.org

1, 1, 1, 1, 0, 1, 1, 1, 0, 0, 1, 1, 0, 1, 1, 1, 1, 0, 0, 0, 0, 1, 1, 1, 0, 0, 1, 1, 0, 1, 1, 1, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0, 1, 1, 0, 1, 1, 1, 1, 0, 0, 0, 0, 1, 1, 1, 0, 0, 1, 1, 0, 1, 1, 1, 1, 0, 1, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 1, 1, 1, 0, 0, 1, 1, 0, 1, 1, 1, 0, 1, 0, 0, 0, 0, 0, 0, 0
Offset: 0

Views

Author

Jonathan Vos Post, Sep 07 2005

Keywords

Examples

			a(4) = 0 because 4 (base 2) = 100, which has 2 (prime) consecutive zeros.
a(8) = 0 because 8 (base 2) = 1000, which has 3 (prime) consecutive zeros.
a(9) = 0 because 9 (base 2) = 1001, which has 2 (prime) consecutive zeros.
a(16) = 1 because 16 (base 2) = 10000, which has 4 (composite) consecutive zeros, even though there are subblocks of zeros of lengths 2 and 3.
a(32) = 0 because 32 (base 2) = 100000, which has 5 (prime) consecutive zeros.
		

References

  • J.-P. Allouche and J. Shallit, Automatic Sequences, Cambridge Univ. Press, 2003, p. 157.

Crossrefs

Programs

  • Mathematica
    f[n_] := If[Or @@ (First[ # ] == 0 && PrimeQ[Length[ # ]] &) /@ Split[IntegerDigits[n, 2]], 0, 1]; Table[f[n], {n, 0, 120}] (* Ray Chandler, Sep 16 2005 *)

Extensions

Extended by Ray Chandler, Sep 16 2005