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.

A095079 Primes with two 0-bits in their binary expansion.

Original entry on oeis.org

19, 43, 53, 79, 103, 107, 109, 367, 379, 431, 439, 443, 463, 487, 491, 499, 751, 863, 887, 983, 1013, 1279, 1471, 1531, 1663, 1759, 1783, 1787, 1789, 1951, 1979, 1999, 2011, 2027, 2029, 3067, 3581, 3823, 4027, 5119, 6079, 6911, 7039, 7103
Offset: 1

Views

Author

Antti Karttunen, Jun 01 2004

Keywords

Crossrefs

Cf. A095059.

Programs

  • Mathematica
    Select[Prime[Range[1000]], DigitCount[#, 2, 0] == 2 &]
  • PARI
    { forprime(p=2,8000,
      v=binary(p); s=0;
      for(k=1,#v, s+=if(v[k]==0,+1,0));
      if(s==2,print1(p,", "))
    ) }
    
  • Python
    from sympy import isprime
    from itertools import combinations, count, islice
    def agen(): # generator of terms
        for d in count(2):
            b = (1<<(d+2))-1
            for i, j in combinations(range(d), 2):
                if isprime(t:=b-(1<<(d-i))-(1<<(d-j))):
                    yield t
    print(list(islice(agen(), 43))) # Michael S. Branicky, Dec 27 2023