A144754 Integers that have a prime number of 0's in their binary expansion.
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
Examples
66 written in binary is 1000010. This has five 0's and five is a prime. So 66 is included in the sequence.
Links
- Indranil Ghosh, Table of n, a(n) for n = 1..25000
Crossrefs
Cf. A052294.
Programs
-
Mathematica
Select[Range@ 120, PrimeQ@ DigitCount[#, 2, 0] &] (* Michael De Vlieger, Oct 26 2017 *)
-
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
Extensions
Many more terms from Reikku Kulon, Sep 21 2008
Name edited by Michel Marcus, Apr 30 2021