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.

Showing 1-5 of 5 results.

A110472 Numbers n such that n in binary representation has a block of exactly a semiprime number of zeros.

Original entry on oeis.org

16, 33, 48, 64, 66, 67, 80, 97, 112, 129, 132, 133, 134, 135, 144, 161, 176, 192, 194, 195, 208, 225, 240, 258, 259, 264, 265, 266, 267, 268, 269, 270, 271, 272, 289, 304, 320, 322, 323, 336, 353, 368, 385, 388, 389, 390, 391, 400, 417, 432, 448, 450, 451
Offset: 1

Views

Author

Jonathan Vos Post, Sep 08 2005

Keywords

Comments

a(n) is the index of zeros in the complement of the semiprime analog of the Baum-Sweet sequence, which is b(n) = 1 if the binary representation of n contains no block of consecutive zeros of exactly semiprime length; otherwise b(n) = 0.

Examples

			a(1) = 16 because 16 (base 2) = 10000, which has a block of 4 zeros, where 4 is a semiprime (A001358(1)).
a(2) = 33 because 33 (base 2) = 100001, which has a block of 4 zeros.
a(3) = 48 because 48 (base 2) = 110000, which has a block of 4 zeros.
a(4) = 64 because 64 (base 2) = 1000000, which has a block of 6 zeros, where 6 is a semiprime (A001358(2)).
512 is in this sequence because 512 (base 2) = 1000000000, which has a block of 9 zeros, where 9 is a semiprime (A001358(3)).
		

References

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

Crossrefs

Programs

  • Mathematica
    f[n_] := If[Or @@ (First[ # ] == 0 && Plus @@ Last /@ FactorInteger[Length[ # ]] == 2 &) /@ Split[IntegerDigits[n, 2]], 0, 1]; Select[Range[450], f[ # ] == 0 &] (* Ray Chandler, Sep 16 2005 *)
    Select[Range[500],AnyTrue[Length/@Select[Split[IntegerDigits[#,2]],#[[1]] == 0&],PrimeOmega[#]==2&]&] (* The program uses the AnyTrue function from Mathematica version 10 *) (* Harvey P. Dale, May 05 2018 *)

Extensions

Extended by Ray Chandler, Sep 16 2005

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

A110529 Numbers n such that n in ternary representation (A007089) has a block of exactly a prime number of consecutive zeros.

Original entry on oeis.org

9, 18, 27, 28, 29, 36, 45, 54, 55, 56, 63, 72, 82, 83, 84, 85, 86, 87, 88, 89, 90, 99, 108, 109, 110, 117, 126, 135, 136, 137, 144, 153, 163, 164, 165, 166, 167, 168, 169, 170, 171, 180, 189, 190, 191, 198, 207, 216, 217, 218, 225, 234, 243, 246, 247, 248, 249
Offset: 1

Views

Author

Jonathan Vos Post, Sep 11 2005

Keywords

Comments

Related to the Baum-Sweet sequence, but ternary rather than binary and prime rather than odd.
a(n) is in this sequence iff n (base 3) = A007089(n) has a block (not a subblock) of a prime number (A000040) of consecutive zeros.

Examples

			a(1) = 9 because 9 (base 3) = 100, which has a block of 2 zeros.
a(2) = 18 because 18 (base 3) = 200, which has a block of 2 zeros.
a(3) = 27 because 27 (base 3) = 1000, which has a block of 3 zeros.
81 is not in this sequence because 81 (base 3) = 10000 has a block of 4 consecutive zeros and it does not matter that this has subblocks with 2 or 3 consecutive zeros because subblocks do not count here.
243 is in this sequence because 243 (base 3) = 100000, which has a block of 5 zeros.
252 is in this sequence because 252 (base 3) = 100100 which has two blocks of 2 consecutive zeros, but we do not require there to be only one such prime-zeros block.
2187 is in this sequence because 2187 (base 3) = 10000000, which has a block of 7 zeros.
		

References

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

Crossrefs

Programs

  • Mathematica
    Select[Range[250], Or @@ (First[ # ] == 0 && PrimeQ[Length[ # ]] &) /@ Split[IntegerDigits[ #, 3]] &] (* Ray Chandler, Sep 12 2005 *)
  • Python
    from re import split
    from sympy import isprime
    def ternary (n):
        if n == 0:
            return '0'
        nums = []
        while n:
            n, r = divmod(n, 3)
            nums.append(str(r))
        return ''.join(reversed(nums))
    seq_list, n = [],1
    while len(seq_list) < 10000:
        for d in split('1+|2+', ternary(n)[1:]):
            if isprime(len(d)):
                seq_list.append(n)
        n += 1
    # W. Zane Billings, Jun 28 2019

A110502 Numbers n such that n in binary representation has a block of exactly a nontrivial square number of zeros.

Original entry on oeis.org

16, 33, 48, 66, 67, 80, 97, 112, 132, 133, 134, 135, 144, 161, 176, 194, 195, 208, 225, 240, 264, 265, 266, 267, 268, 269, 270, 271, 272, 289, 304, 322, 323, 336, 353, 368, 388, 389, 390, 391, 400, 417, 432, 450, 451, 464, 481, 496, 512, 528, 529, 530, 531
Offset: 1

Views

Author

Jonathan Vos Post, Sep 11 2005

Keywords

Comments

a(n) is the index of zeros in the complement of the square analog of the Baum-Sweet sequence, which is b(n) = 1 if the binary representation of n contains no block of consecutive zeros of exactly a nontrivial square number length; otherwise b(n) = 0.

Examples

			a(1) = 16 because 16 (base 2) = 10000, which has a block of 4 = 2^2 zeros.
a(2) = 33 because 33 (base 2) = 100001, which has a block of 4 zeros.
a(3) = 48 because 48 (base 2) = 110000, which has a block of 4 zeros.
a(49) = 512 because 512 (base 2) = 1000000000, with a block of 9 = 3^2 zeros.
Similarly, there are blocks of exactly 9 zeros in 1025, 1536, 2050, 2051, 3073, 3584, 7149, 8196, 8197, 8198, 8199.
65536, 131073, 196608, 262146 and 262147 are in this sequence because (base 2) they each have a block of 16 = 4^2 zeros.
33554432 has a block of 25 = 5^2 zeros.
		

References

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

Crossrefs

Programs

  • Maple
    filter:= proc(n) local L,nL,A,B;
      L:= convert(n,base,2);
      nL:= nops(L);
      A:= select(t -> L[t]=0 and (t=1 or L[t-1]=1), [$1..nL]);
      B:= select(t -> L[t]=1 and L[t-1]=0, [$2..nL]);
      ormap(t -> t>3 and issqr(t),B-A)
    end proc:select(filter, [$1..1000]); # Robert Israel, Sep 01 2021
  • Mathematica
    Select[Range[531], Or @@ (First[ # ] == 0 && Length[ # ] > 1 && IntegerQ[Length[ # ]^(1/2)] &) /@ Split[IntegerDigits[ #, 2]] &] (* Ray Chandler, Sep 12 2005 *)
  • Python
    from math import isqrt
    from itertools import groupby
    def is_nt_sqr(n): # is nontrivial square
        return n > 1 and isqrt(n)**2 == n
    def ok(n):
        b = bin(n)[2:]
        return any(k == '0' and is_nt_sqr(len(list(g))) for k, g in groupby(b))
    print(list(filter(ok, range(532)))) # Michael S. Branicky, Sep 01 2021

Formula

a(n) is in this sequence iff n (base 2) has a block (not a sub-block) of k^2 = A000290(k) consecutive zeros for k>1.

Extensions

Corrected and extended by Ray Chandler, Sep 12 2005

A110562 Numbers n such that n in binary representation has a block of exactly a nontrivial pentagonal number of zeros.

Original entry on oeis.org

32, 65, 96, 130, 131, 160, 193, 224, 260, 261, 262, 263, 288, 321, 352, 386, 387, 416, 449, 480, 520, 521, 522, 523, 524, 525, 526, 527, 544, 577, 608, 642, 643, 672, 705, 736, 772, 773, 774, 775, 800, 833, 864, 898, 899, 928, 961, 992, 1040, 1041, 1042
Offset: 1

Views

Author

Jonathan Vos Post, Sep 12 2005

Keywords

Comments

a(n) is the index of zeros in the complement of the pentagonal number analog of the Baum-Sweet sequence, which is b(n) = 1 if the binary representation of n contains no block of consecutive zeros of exactly a nontrivial pentagonal number length A000326(i) for i>1; otherwise b(n) = 0.

Examples

			a(1) = 32 because 32 (base 2) = 100000, which has a block of 5 = A000326(2) zeros.
a(2) = 65 because 65 (base 2) = 1000001, which has a block of 5 zeros.
64 is not in this sequence because, though 64 (base 2) = 1000000 has a block of 6 zeros, which has subblocks of 5 zeros, subblocks do not count.
2080 is in this sequence because 2080 (base 2) = 100000100000 has 2 blocks of 5 zeros, but we do not require only one such 5-zero block.
4096 is in this sequence because 4096 (base 2) = 1000000000000, which has a block of 12 = A000326(3) zeros, as do 8193 and many more.
4194304 is in this sequence because 4194304 (base 2) = 10000000000000000000000, which has a block of 22 = A000326(4) zeros.
		

References

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

Crossrefs

Extensions

Corrected by Ray Chandler, Sep 17 2005
Showing 1-5 of 5 results.