|
|
A081092
|
|
Primes having in binary representation a prime number of 1's.
|
|
14
|
|
|
3, 5, 7, 11, 13, 17, 19, 31, 37, 41, 47, 59, 61, 67, 73, 79, 97, 103, 107, 109, 127, 131, 137, 151, 157, 167, 173, 179, 181, 191, 193, 199, 211, 223, 227, 229, 233, 239, 241, 251, 257, 271, 283, 307, 313, 331, 367, 379, 397, 409, 419, 421, 431, 433, 439, 443
(list;
graph;
refs;
listen;
history;
text;
internal format)
|
|
|
OFFSET
|
1,1
|
|
COMMENTS
|
Same as primes with prime binary digit sum.
Primes with prime decimal digit sum areA046704.
Sum_{a(n) < x} 1/a(n) is asymptotic to log(log(log(x))) as x -> infinity; see Harman (2012). Thus the sequence is infinite. -Jonathan Sondow,Jun 09 2012
|
|
LINKS
|
|
|
EXAMPLE
|
15th prime = 47 = '101111' with five 1's, therefore 47 is in the sequence.
|
|
MAPLE
|
q:= n-> isprime(n) and isprime(add(i, i=Bits[Split](n))):
|
|
MATHEMATICA
|
Clear[BinSumOddQ]; BinSumPrimeQ[a_]:=Module[{i, s=0}, s=0; For[i=1, i<=Length[IntegerDigits[a, 2]], s+=Extract[IntegerDigits[a, 2], i]; i++ ]; PrimeQ[s]]; lst={}; Do[p=Prime[n]; If[BinSumPrimeQ[p], AppendTo[lst, p]], {n, 4!}]; lst (*Vladimir Joseph Stephan Orlovsky,Apr 06 2009 *)
Select[Prime[Range[100]], PrimeQ[Apply[Plus, IntegerDigits[#, 2]]] &] (*Jonathan Sondow,Jun 09 2012 *)
|
|
PROG
|
(Haskell)
a081092 n = a081092_list!! (n-1)
a081092_list = filter ((== 1). a010051') a052294_list
(PARI) lista(nn) = {forprime(p=2, nn, if (isprime(hammingweight(p)), print1(p, "," )); ); } \\Michel Marcus,Jan 16 2015
(Python)
from sympy import isprime
def ok(n): return isprime(n.bit_count()) and isprime(n)
|
|
CROSSREFS
|
|
|
KEYWORD
|
nonn,base
|
|
AUTHOR
|
|
|
STATUS
|
approved
|
|
|
|