OFFSET
1,1
COMMENTS
Subsequence of primes is A050415 and then, the obtained prime is always 2. We have: prime p = 2^k-3, k>=3 -> p = 11...1101_2 with a string of (k-2) digits 1 before '01' ==> 00...0010_2 = 10_2 -> 2_10. - Bernard Schott, Oct 21 2021
MAPLE
q:= n-> isprime(Bits[Nand](n$2)):
select(q, [$1..300])[]; # Alois P. Heinz, Sep 03 2021
MATHEMATICA
Select[Range[200], PrimeQ @ FromDigits[IntegerDigits[#, 2] /. {0 -> 1, 1 -> 0}, 2] &] (* Amiram Eldar, Sep 03 2021 *)
PROG
(Python)
from sympy import isprime
def comp(s): z, o = ord('0'), ord('1'); return s.translate({z:o, o:z})
def ok(n): return isprime(int(comp(bin(n)[2:]), 2))
print(list(filter(ok, range(214)))) # Michael S. Branicky, Sep 03 2021
(PARI) isok(m) = isprime(fromdigits(apply(x->1-x, binary(m)), 2)); \\ Michel Marcus, Sep 03 2021
(PARI) is(n) = isprime(1<<(logint(n, 2) + 1) - n - 1) \\ David A. Corneth, Sep 03 2021
CROSSREFS
KEYWORD
nonn,base
AUTHOR
Srijan Suryansh, Sep 03 2021
EXTENSIONS
More terms from Michael S. Branicky, Sep 03 2021
STATUS
approved
