login

Year-end appeal: Please make a donation to the OEIS Foundation to support ongoing development and maintenance of the OEIS. We are now in our 61st year, we have over 378,000 sequences, and we’ve reached 11,000 citations (which often say “discovered thanks to the OEIS”).

A360385
prime(k) such that (k BitXOR prime(k)) is prime, where BitXOR is the binary bitwise XOR.
1
2, 7, 13, 29, 37, 43, 53, 61, 71, 79, 101, 131, 151, 199, 223, 281, 293, 317, 337, 349, 383, 409, 421, 457, 521, 557, 569, 641, 683, 733, 911, 983, 1013, 1049, 1151, 1223, 1249, 1373, 1429, 1511, 1531, 1721, 1747, 1759, 1789, 1831, 1931, 2017, 2029, 2213, 2311
OFFSET
1,1
LINKS
EXAMPLE
2 is a term since k = primepi(2) = 1 and (1 BitXOR 2) = 3 is a prime number.
151 is a term since k = primepi(151) = 36 and (36 BitXOR 151) = 179 is a prime number.
MAPLE
q:= p-> andmap(isprime, [p, Bits[Xor](p, numtheory[pi](p))]):
select(q, [$2..3000])[]; # Alois P. Heinz, Feb 05 2023
MATHEMATICA
Select[Prime[Range[400]], PrimeQ[BitXor[#, PrimePi[#]]] &] (* Amiram Eldar, Feb 05 2023 *)
PROG
(PARI) { p = primes([1, 2311]); for (k=1, #p, if (isprime(bitxor(k, p[k])), print1 (p[k]", "))) } \\ Rémy Sigrist, Feb 05 2023
(Python)
from sympy import isprime, primerange
print([p for i, p in enumerate(primerange(2, 10**4), 1) if isprime(i^p)]) # Michael S. Branicky, Feb 05 2023
CROSSREFS
Sequence in context: A275491 A360673 A183435 * A141777 A297883 A215206
KEYWORD
nonn,base
AUTHOR
Najeem Ziauddin, Feb 05 2023
STATUS
approved