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!)
A346408 Primes whose bitwise XOR of decimal digits is a prime. 1

%I #21 Jul 26 2021 06:52:13

%S 2,3,5,7,13,29,31,41,43,47,61,83,103,113,131,137,139,151,157,173,193,

%T 211,223,227,233,241,263,269,277,281,311,317,337,353,367,373,379,389,

%U 397,401,409,421,443,461,467,487,557,571,577,599,601,641,647,673,683

%N Primes whose bitwise XOR of decimal digits is a prime.

%H Wikipedia, <a href="https://en.wikipedia.org/wiki/Bitwise operation">Bitwise operation</a>

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

%p b:= l-> `if`(l=[], 0, Bits[Xor](l[1], b(subsop(1=[][], l)))):

%p q:= n-> isprime(b(convert(n, base, 10))):

%p select(q, [ithprime(i)$i=1..160])[]; # _Alois P. Heinz_, Jul 21 2021

%t Select[Range[1000], PrimeQ[#] && PrimeQ[BitXor @@ IntegerDigits[#]] &] (* _Amiram Eldar_, Jul 21 2021 *)

%o (Sage)

%o def XOR(a, b):

%o return a ^^ b

%o [n for n in (0..100) if (n in Primes() and reduce(XOR, map(lambda x: int(x), str(n))) in Primes())]

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

%K base,nonn,less

%O 1,1

%A _Jeremias M. Gomes_, Jul 21 2021

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 24 05:36 EDT 2024. Contains 371918 sequences. (Running on oeis4.)