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.

A360383 prime(k) such that (k BitOR prime(k)) is prime, where BitOR is the binary bitwise OR.

Original entry on oeis.org

2, 3, 5, 7, 17, 23, 29, 31, 43, 47, 53, 59, 67, 89, 101, 103, 107, 113, 127, 131, 163, 167, 173, 181, 191, 199, 233, 257, 269, 281, 317, 331, 353, 359, 367, 373, 379, 383, 389, 397, 401, 419, 421, 439, 463, 479, 503, 509, 521, 523, 563, 577, 587, 631, 641, 719
Offset: 1

Views

Author

Najeem Ziauddin, Feb 04 2023

Keywords

Comments

All Mersenne primes (A000668) belong to the sequence. - Rémy Sigrist, Feb 05 2023

Examples

			2 is a term since k = primepi(2) = 1 and (1 BitOR 2) = 3 is a prime number.
101 is a term since k = primepi(101) = 26 and (26 BitOR 101) = 127 is a prime number.
		

Crossrefs

Programs

  • Maple
    q:= p-> andmap(isprime, [p, Bits[Or](p, numtheory[pi](p))]):
    select(q, [$2..1000])[];  # Alois P. Heinz, Feb 05 2023
  • Mathematica
    Select[Prime[Range[130]], PrimeQ[BitOr[#, PrimePi[#]]] &] (* Amiram Eldar, Feb 05 2023 *)
  • PARI
    { p = primes([1,719]); for (k=1, #p, if (isprime(bitor(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, 800), 1) if isprime(i|p)]) # Michael S. Branicky, Feb 05 2023