login

Year-end appeal: Please make a donation to the OEIS Foundation to support ongoing development and maintenance of the OEIS. We are now in our 61st year, we have over 378,000 sequences, and we’ve reached 11,000 citations (which often say “discovered thanks to the OEIS”).

A144754
Integers that have a prime number of 0's in their binary expansion.
5
4, 8, 9, 10, 12, 17, 18, 19, 20, 21, 22, 24, 25, 26, 28, 32, 35, 37, 38, 39, 41, 42, 43, 44, 45, 46, 49, 50, 51, 52, 53, 54, 56, 57, 58, 60, 65, 66, 68, 71, 72, 75, 77, 78, 79, 80, 83, 85, 86, 87, 89, 90, 91, 92, 93, 94, 96, 99, 101, 102, 103, 105, 106, 107, 108, 109, 110
OFFSET
1,1
LINKS
EXAMPLE
66 written in binary is 1000010. This has five 0's and five is a prime. So 66 is included in the sequence.
MATHEMATICA
Select[Range@ 120, PrimeQ@ DigitCount[#, 2, 0] &] (* Michael De Vlieger, Oct 26 2017 *)
PROG
(PARI) isok(n) = isprime(#binary(n) - hammingweight(n)); \\ Michel Marcus, Feb 23 2016
(Python)
from sympy import isprime
i=j=1
while j<=250:
if isprime(bin(i)[2:].count("0")):
print(str(j)+" "+str(i))
j+=1
i+=1 # Indranil Ghosh, Feb 03 2017
CROSSREFS
Cf. A052294.
Sequence in context: A193166 A155101 A158582 * A080970 A288862 A274584
KEYWORD
base,nonn
AUTHOR
Leroy Quet, Sep 20 2008
EXTENSIONS
Many more terms from Reikku Kulon, Sep 21 2008
Name edited by Michel Marcus, Apr 30 2021
STATUS
approved