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-6 of 6 results.

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

Original entry on oeis.org

8, 17, 24, 34, 35, 40, 49, 56, 64, 68, 69, 70, 71, 72, 81, 88, 98, 99, 104, 113, 120, 129, 136, 137, 138, 139, 140, 141, 142, 143, 145, 152, 162, 163, 168, 177, 184, 192, 196, 197, 198, 199, 200, 209, 216, 226, 227, 232, 241, 248, 258, 259, 264, 272, 273, 274
Offset: 1

Views

Author

Jonathan Vos Post, Sep 08 2005

Keywords

Comments

a(n) is the index of zeros in the complement of the triangular 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 triangular number length >1; otherwise b(n) = 0. The sequence b(n) = 0,0,0,0,0,0,0,0,1,0,0,0,0,0,0,0,0,1,... is not yet in the OEIS and is too sparse to be attractively shown.
a(n) is in this sequence iff a(n) (base 2) has a block (not a subblock) of A000217(k) zeros for some k>1.

Examples

			a(1) = 8 because 8 (base 2) = 1000, which has a block of 3 zeros, where 3 is a nontrivial triangular number (A000217(2)).
16 is not an element of this sequence because 16 (base 2) = 10000 which has a block of 4 zeros, which is not a triangular number (even though it has subblocks of the triangular number 3 zeros).
a(2) = 17 because 17 (base 2) = 10001, which has a block of 3 zeros (and is a Fermat prime).
a(4) = 34 because 34 (base 2) = 100010, which has a block of 3 zeros.
a(9) = 64 because 64 (base 2) = 1000000, which has a block of 6 zeros, where 6 is a nontrivial triangular number (A000217(3)).
2049 is in this sequence because 2049 (base 2) = 100000000001, which has a block of 10 zeros, where 10 is a nontrivial triangular number (A000217(4)).
65537 is in this sequence because 65537 (base 2) = 10000000000000001, which has a block of 15 zeros, where 15 is a nontrivial triangular number (A000217(5)) and happens to be a Fermat prime.
4194305 is in this sequence because, base 2, has a block of 21 zeros, where 21 is a nontrivial triangular number (A000217(6)),
		

References

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

Crossrefs

Programs

  • Mathematica
    f[n_] := If[Or @@ (First[ # ] == 0 && Length[ # ] > 1 && IntegerQ[(1 + 8*Length[ # ])^(1/2)] &) /@ Split[IntegerDigits[n, 2]], 0, 1]; Select[Range[500], f[ # ] == 0 &] (* Ray Chandler, Sep 16 2005 *)
    ntnQ[n_]:=AnyTrue[Length/@Select[Split[IntegerDigits[n,2]],FreeQ[#,1]&],#>1 && OddQ[ Sqrt[8#+1]]&]; Select[Range[300],ntnQ] (* Requires Mathematica version 10 or later *) (* Harvey P. Dale, Oct 31 2020 *)

Extensions

Corrected 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

A102029 Smallest semiprime with Hamming weight n (i.e., smallest semiprime with exactly n ones when written in binary), or -1 if no such number exists.

Original entry on oeis.org

4, 6, 14, 15, 55, 95, 247, 447, 511, 1535, 2047, 7167, 12287, 32255, 49151, 98303, 196607, 393215, 983039, 1572863, 3145727, 6291455, 8388607, 33423359, 50331647, 117440511, 201326591, 528482303, 805306367, 1879048191, 3221225471
Offset: 1

Views

Author

Jonathan Vos Post, Jun 23 2007

Keywords

Comments

Semiprime analog of A061712. Extended by Stefan Steinerberger. Includes the subset Mersenne semiprimes A092561.

Examples

			a(1) = 4 because the first semiprime A001358(1) is 4 (base 10) which is written 100 in binary, the latter representation having exactly 1 one.
a(2) = 6 since A001358(2) = 6 = 110 (base 2) has exactly 2 ones.
a(4) = 15 since A001358(6) = 15 = 1111 (base 2) has exactly 4 ones and, as it also has no zeros, is the smallest of the Mersenne semiprimes.
		

Crossrefs

Programs

  • Mathematica
    Join[{4},Table[SelectFirst[Sort[FromDigits[#,2]&/@Permutations[ Join[ PadRight[{}, n,1],{0}]]],PrimeOmega[#]==2&],{n,2,40}]] (* Harvey P. Dale, Feb 06 2015 *)

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-6 of 6 results.