The OEIS mourns the passing of Jim Simons and is grateful to the Simons Foundation for its support of research in many branches of science, including the OEIS.
login
The OEIS is supported by the many generous donors to the OEIS Foundation.

 

Logo
Hints
(Greetings from The On-Line Encyclopedia of Integer Sequences!)
A343258 Numbers whose binary representation has a prime number of zeros and a prime number of ones. 1
9, 10, 12, 17, 18, 19, 20, 21, 22, 24, 25, 26, 28, 35, 37, 38, 41, 42, 44, 49, 50, 52, 56, 65, 66, 68, 72, 79, 80, 87, 91, 93, 94, 96, 103, 107, 109, 110, 115, 117, 118, 121, 122, 124, 131, 133, 134, 137, 138, 140, 143, 145, 146, 148, 151, 152, 155, 157, 158 (list; graph; refs; listen; history; text; internal format)
OFFSET
1,1
COMMENTS
Terms of 4, 5 and 6 total bits (9 through 56) are the same as A089648.
LINKS
Alois P. Heinz, Table of n, a(n) for n = 1..10000 (first 78 terms from Jean-Jacques Vaudroz)
MAPLE
q:= n->(l->(t->andmap(isprime, [t, nops(l)-t]))(add(i, i=l)))(Bits[Split](n)):
select(q, [$1..200])[]; # Alois P. Heinz, Apr 11 2021
MATHEMATICA
Select[Range[160], And @@ PrimeQ[DigitCount[#, 2]] &] (* Amiram Eldar, Apr 09 2021 *)
PROG
(PARI)
isa(n)= isprime(hammingweight(n));
isb(n)= isprime(#binary(n) - hammingweight(n));
isok(n) = isa(n) && isb(n);
(Python)
from sympy import isprime
def ok(n): b = bin(n)[2:]; return all(isprime(b.count(d)) for d in "01")
print(list(filter(ok, range(159)))) # Michael S. Branicky, Sep 10 2021
CROSSREFS
Intersection of A052294 and A144754.
Cf. A089648.
Sequence in context: A242475 A160947 A158581 * A078459 A156345 A078390
KEYWORD
nonn,base
AUTHOR
STATUS
approved

Lookup | Welcome | Wiki | Register | Music | Plot 2 | Demos | Index | Browse | More | WebCam
Contribute new seq. or comment | Format | Style Sheet | Transforms | Superseeker | Recents
The OEIS Community | Maintained by The OEIS Foundation Inc.

License Agreements, Terms of Use, Privacy Policy. .

Last modified June 12 08:10 EDT 2024. Contains 373325 sequences. (Running on oeis4.)