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!)
A360385 prime(k) such that (k BitXOR prime(k)) is prime, where BitXOR is the binary bitwise XOR. 1

%I #17 Feb 23 2023 02:00:17

%S 2,7,13,29,37,43,53,61,71,79,101,131,151,199,223,281,293,317,337,349,

%T 383,409,421,457,521,557,569,641,683,733,911,983,1013,1049,1151,1223,

%U 1249,1373,1429,1511,1531,1721,1747,1759,1789,1831,1931,2017,2029,2213,2311

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

%H Robert Israel, <a href="/A360385/b360385.txt">Table of n, a(n) for n = 1..10000</a>

%e 2 is a term since k = primepi(2) = 1 and (1 BitXOR 2) = 3 is a prime number.

%e 151 is a term since k = primepi(151) = 36 and (36 BitXOR 151) = 179 is a prime number.

%p q:= p-> andmap(isprime, [p, Bits[Xor](p, numtheory[pi](p))]):

%p select(q, [$2..3000])[]; # _Alois P. Heinz_, Feb 05 2023

%t Select[Prime[Range[400]], PrimeQ[BitXor[#, PrimePi[#]]] &] (* _Amiram Eldar_, Feb 05 2023 *)

%o (PARI) { p = primes([1,2311]); for (k=1, #p, if (isprime(bitxor(k,p[k])), print1 (p[k]", "))) } \\ _Rémy Sigrist_, Feb 05 2023

%o (Python)

%o from sympy import isprime, primerange

%o print([p for i, p in enumerate(primerange(2, 10**4), 1) if isprime(i^p)]) # _Michael S. Branicky_, Feb 05 2023

%Y Cf. A000040, A000720.

%K nonn,base

%O 1,1

%A _Najeem Ziauddin_, Feb 05 2023

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 April 16 01:40 EDT 2024. Contains 371696 sequences. (Running on oeis4.)