A339247 The primes that yield twice a prime when each bit of their binary expansion is inverted.
11, 17, 37, 41, 53, 59, 89, 101, 113, 137, 149, 173, 181, 193, 197, 229, 233, 241, 251, 257, 293, 317, 353, 389, 449, 521, 541, 557, 569, 577, 601, 641, 661, 677, 709, 761, 769, 797, 809, 821, 829, 857, 877, 881, 929, 937
Offset: 1
Examples
a(1) = 11 = 1011_2 —inv-> 100_2 = 4 = 2 * 2. a(2) = 17 = 10001_2 -inv-> 1110_2 = 14 = 2 * 7. a(3) = 37 = 100101_2 -inv-> 11010_2 = 26 = 2 * 13.
Links
- Robert Israel, Table of n, a(n) for n = 1..10000
Programs
-
Maple
filter:= proc(n) isprime(n) and isprime((2^(1+ilog2(n))-1-n)/2) end proc: select(filter, [seq(i,i=3..1000,2)]); # Robert Israel, Jun 27 2023
-
Mathematica
Select[Range[1000], And @@ PrimeQ[{#, (2^Ceiling @ Log2[#] - # - 1)/2}] &] (* Amiram Eldar, Dec 01 2020 *)
-
PARI
isok(p) = if ((p>2) && isprime(p), isprime(fromdigits(apply(x->1-x, binary(p)), 2)/2)); \\ Michel Marcus, Dec 01 2020
-
Python
from sympy import isprime from sympy import prime for i in range(1,201): j=prime(i) xor=2**len(bin(j).strip('0b'))-1 p=(j^xor)//2 if isprime(p): print(j,end=', ')
Comments