OFFSET
1,1
COMMENTS
LINKS
Indranil Ghosh, Table of n, a(n) for n = 1..20000 (terms 1..1000 from Reinhard Zumkeller)
A. Karttunen and J. Moyer, C-program for computing the initial terms of this sequence
EXAMPLE
97 is in the sequence because 97 is a prime and 97_10 = 1100001_2. The number of 0's in 1100001 is 4 and the number of 1's is 3. - Indranil Ghosh, Jan 31 2017
MATHEMATICA
Select[Prime[Range[500]], Differences[DigitCount[#, 2]] == {1} &]
PROG
(PARI) isA095072(n)=my(v=binary(n)); #v==2*sum(i=1, #v, v[i])+1&&isprime(n)
(PARI) forprime(p=2, 4250, v=binary(p); s=0; for(k=1, #v, s+=if(v[k]==0, +1, -1)); if(s==1, print1(p, ", ")))
(Haskell)
a095072 n = a095072_list !! (n-1)
a095072_list = filter ((== 1) . a010051' . fromIntegral) a031444_list
-- Reinhard Zumkeller, Mar 31 2015
(Python)
#Program to generate the b-file
from sympy import isprime
i=1
j=1
while j<=200:
if isprime(i) and bin(i)[2:].count("0")-bin(i)[2:].count("1")==1:
print(str(j)+" "+str(i))
j+=1
i+=1 # Indranil Ghosh, Jan 31 2017
CROSSREFS
KEYWORD
nonn,base,easy
AUTHOR
Antti Karttunen, Jun 01 2004
STATUS
approved