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

A318940 Primes whose binary representation contains a consecutive string of zeros of prime length.

Original entry on oeis.org

17, 19, 37, 41, 71, 73, 79, 83, 89, 101, 103, 113, 131, 137, 139, 149, 151, 157, 163, 167, 179, 193, 197, 199, 211, 227, 229, 233, 241, 257, 263, 277, 281, 283, 293, 307, 311, 313, 317, 331, 337, 359, 397, 401, 409, 419, 421, 433, 449, 457
Offset: 1

Views

Author

N. J. A. Sloane, Sep 17 2018

Keywords

Comments

Most primes appear to fall into this category. - Charlie Neder, Sep 17 2018

Crossrefs

A subsequence of A319302, which suggested this sequence.

Programs

  • Mathematica
    Prime@ Position[Array[If[Length@ # == 0, {0}, Length /@ #] &@ DeleteCases[Split@ IntegerDigits[Prime@ #, 2], ?(First@ # == 1 &)] &, 100], ?(AnyTrue[#, PrimeQ] &), {1}, Heads -> False][[All, 1]] (* Michael De Vlieger, Nov 25 2018 *)
    brpQ[p_]:=AnyTrue[Length/@Select[Split[IntegerDigits[p,2]],#[[1]]==0&],PrimeQ]; Select[Prime[Range[100]],brpQ] (* Harvey P. Dale, Jul 30 2025 *)
  • PARI
    ok(n)={if(isprime(n), while(n, my(t=valuation(n,2)); if(isprime(t), return(1)); n >>= t + 1)); 0} \\ Andrew Howroyd, Nov 09 2018

Extensions

More terms from Charlie Neder, Sep 17 2018

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

Views

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
Showing 1-2 of 2 results.