OFFSET
1,1
LINKS
Wikipedia, Bitwise operation
EXAMPLE
421 is a term because it is a prime whose bitwise XOR of digits is 7 which is also a prime.
MAPLE
b:= l-> `if`(l=[], 0, Bits[Xor](l[1], b(subsop(1=[][], l)))):
q:= n-> isprime(b(convert(n, base, 10))):
select(q, [ithprime(i)$i=1..160])[]; # Alois P. Heinz, Jul 21 2021
MATHEMATICA
Select[Range[1000], PrimeQ[#] && PrimeQ[BitXor @@ IntegerDigits[#]] &] (* Amiram Eldar, Jul 21 2021 *)
PROG
(Sage)
def XOR(a, b):
return a ^^ b
[n for n in (0..100) if (n in Primes() and reduce(XOR, map(lambda x: int(x), str(n))) in Primes())]
CROSSREFS
KEYWORD
base,nonn,less
AUTHOR
Jeremias M. Gomes, Jul 21 2021
STATUS
approved