cp's OEIS Frontend

This is a front-end for the Online Encyclopedia of Integer Sequences, made by Christian Perfect. The idea is to provide OEIS entries in non-ancient HTML, and then to think about how they're presented visually. The source code is on GitHub.

A346408 Primes whose bitwise XOR of decimal digits is a prime.

Original entry on oeis.org

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

Views

Author

Jeremias M. Gomes, Jul 21 2021

Keywords

Examples

			421 is a term because it is a prime whose bitwise XOR of digits is 7 which is also a prime.
		

Crossrefs

Cf. A000040, A346511 (XOR of digits of n).

Programs

  • 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 *)
  • 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())]