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
KEYWORD
nonn,base
AUTHOR
Jean-Jacques Vaudroz, Apr 09 2021
STATUS
approved