login
The OEIS is supported by the many generous donors to the OEIS Foundation.

 

Logo
Hints
(Greetings from The On-Line Encyclopedia of Integer Sequences!)
A360383 prime(k) such that (k BitOR prime(k)) is prime, where BitOR is the binary bitwise OR. 1
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 (list; graph; refs; listen; history; text; internal format)
OFFSET
1,1
COMMENTS
All Mersenne primes (A000668) belong to the sequence. - Rémy Sigrist, Feb 05 2023
LINKS
EXAMPLE
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.
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 *)
PROG
(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
CROSSREFS
Sequence in context: A286499 A116947 A066277 * A164134 A152184 A135948
KEYWORD
nonn,base
AUTHOR
Najeem Ziauddin, Feb 04 2023
STATUS
approved

Lookup | Welcome | Wiki | Register | Music | Plot 2 | Demos | Index | Browse | More | WebCam
Contribute new seq. or comment | Format | Style Sheet | Transforms | Superseeker | Recents
The OEIS Community | Maintained by The OEIS Foundation Inc.

License Agreements, Terms of Use, Privacy Policy. .

Last modified May 9 05:44 EDT 2024. Contains 372344 sequences. (Running on oeis4.)