OFFSET
1,1
LINKS
Robert Israel, Table of n, a(n) for n = 1..10000
EXAMPLE
41, a prime, in binary is 101001. This has three 0's and 3 is prime, so 41 is in the sequence.
MAPLE
A080791 := proc(n) local i, dgs ; dgs := convert(n, base, 2) ; nops(dgs)-add(i, i=dgs) ; end: isA144213 := proc(n) local no0 ; no0 := A080791(n) ; if isprime(n) and isprime(no0) then true ; else false; fi; end: for n from 1 to 1200 do if isA144213(n) then printf("%d, ", n) ; fi; od: # R. J. Mathar, Sep 17 2008
# second Maple program:
q:= n-> isprime(n) and isprime(add(1-i, i=Bits[Split](n))):
select(q, [$1..500])[]; # Alois P. Heinz, Dec 27 2023
MATHEMATICA
nmax = 100;
Select[Prime[Range[nmax]],
PrimeQ[Total@Mod[1 + IntegerDigits[#, 2], 2]] &] (* Andres Cicuttin, Jul 08 2020 *)
Select[Prime[Range[100]], PrimeQ[DigitCount[#, 2, 0]]&] (* Harvey P. Dale, Feb 03 2021 *)
PROG
(Python)
from sympy import isprime
def ok(n): return isprime(n.bit_length()-n.bit_count()) and isprime(n)
print([k for k in range(464) if ok(k)]) # Michael S. Branicky, Dec 27 2023
CROSSREFS
KEYWORD
base,nonn
AUTHOR
Leroy Quet, Sep 14 2008
EXTENSIONS
More terms from R. J. Mathar, Sep 17 2008
STATUS
approved