[go: up one dir, main page]

login
A346408
Primes whose bitwise XOR of decimal digits is a prime.
1
2, 3, 5, 7, 13, 29, 31, 41, 43, 47, 61, 83, 103, 113, 131, 137, 139, 151, 157, 173, 193, 211, 223, 227, 233, 241, 263, 269, 277, 281, 311, 317, 337, 353, 367, 373, 379, 389, 397, 401, 409, 421, 443, 461, 467, 487, 557, 571, 577, 599, 601, 641, 647, 673, 683
OFFSET
1,1
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
Cf. A000040, A346511 (XOR of digits of n).
Sequence in context: A114741 A096177 A075238 * A158281 A115261 A063792
KEYWORD
base,nonn,less
AUTHOR
Jeremias M. Gomes, Jul 21 2021
STATUS
approved