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: W. Zane Billings

W. Zane Billings's wiki page.

W. Zane Billings has authored 2 sequences.

A309092 Integers whose hexadecimal representation contains a run of zeros of prime length.

Original entry on oeis.org

256, 512, 768, 1024, 1280, 1536, 1792, 2048, 2304, 2560, 2816, 3072, 3328, 3584, 3840, 4096, 4097, 4098, 4099, 4100, 4101, 4102, 4103, 4104, 4105, 4106, 4107, 4108, 4109, 4110, 4111, 4352, 4608, 4864, 5120, 5376, 5632, 5888, 6144, 6400, 6656, 6912, 7168
Offset: 1

Author

W. Zane Billings, Jul 11 2019

Keywords

Examples

			256 = 100_(16) is a term because 100 has a run of two zeros, and two is prime. 258 = 102_(16) is not a term, because its only run of zeros is of length 1, which is not prime.
		

Crossrefs

Programs

  • Mathematica
    Select[Range@ 7168, Select[Split@ IntegerDigits[#, 16], #[[1]] == 0 && PrimeQ@ Length@ # &] != {} &] (* Giovanni Resta, Jul 16 2019 *)
  • Python
    from re import split
    from sympy import isprime
    seq_list, n = [],1
    while len(seq_list) < 10000:
        for d in split('[1-9]+|[a-f]+', format(n,'x')):
            if isprime(len(d)):
                seq_list.append(n)
        n += 1

A319302 Integers whose binary representation contains a consecutive string of zeros of prime length.

Original entry on oeis.org

4, 8, 9, 12, 17, 18, 19, 20, 24, 25, 28, 32, 34, 35, 36, 37, 38, 39, 40, 41, 44, 49, 50, 51, 52, 56, 57, 60, 65, 68, 69, 70, 71, 72, 73, 74, 75, 76, 77, 78, 79, 81, 82, 83, 84, 88, 89, 92, 96, 98, 99, 100, 101, 102, 103, 104, 105, 108, 113, 114, 115, 116, 120
Offset: 1

Author

W. Zane Billings, Sep 16 2018

Keywords

Examples

			81 = (1010001)_2 is a term because it contains a run of zeros of length 3, and 3 is a prime. 16 = (10000)_2 is not a term because it contains only a run of 4 zeros and 4 is not a prime.
		

Crossrefs

Programs

  • Mathematica
    Select[Range[120], AnyTrue[ Differences@ Flatten@ Position[ IntegerDigits[ 2*# + 1, 2], 1] - 1, PrimeQ] &] (* Giovanni Resta, Sep 17 2018 *)
  • PARI
    is(n) = my(b=binary(n), i=0); for(k=1, #b, if(b[k]==0, i++); if(b[k]==1 || k==#b, if(ispseudoprime(i), return(1), i=0))); 0 \\ Felix Fröhlich, Sep 17 2018
    
  • Python
    from re import split
    from sympy import isprime
    A319302_list, n  = [], 1
    while len(A319302_list) < 10000:
        for d in split('1+',bin(n)[2:]):
            if isprime(len(d)):
                A319302_list.append(n)
                break
        n += 1 # Chai Wah Wu, Oct 02 2018

Extensions

More terms from Giovanni Resta, Sep 17 2018