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.

A360385 prime(k) such that (k BitXOR prime(k)) is prime, where BitXOR is the binary bitwise XOR.

Original entry on oeis.org

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

Views

Author

Najeem Ziauddin, Feb 05 2023

Keywords

Examples

			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.
		

Crossrefs

Programs

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