A281382 Numbers n such that the decimal equivalent of the binary reflected Gray code representation of n is a palindromic prime.
2, 3, 5, 6, 13, 70, 213, 217, 229, 253, 422, 426, 446, 465, 534, 541, 705, 741, 857, 869, 8441, 8481, 9190, 9221, 9293, 10210, 10349, 10453, 10929, 11049, 12006, 12281, 12329, 12721, 12793, 14109, 14282, 20578, 20934, 21009, 21629, 21701, 22810, 22866, 23221, 23421, 28705, 29397
Offset: 1
Examples
213 is in the sequence because A003188(213) = 191 and 191 is a palindromic prime.
Links
- Indranil Ghosh and Chai Wah Wu, Table of n, a(n) for n = 1..13824, first 1281 terms from Indranil Ghosh.
Programs
-
Mathematica
Select[Range@ 30000, And[PrimeQ@ #, Reverse@ # == # &@ IntegerDigits@ #] &@ BitXor[#, Floor[#/2]] &] (* Michael De Vlieger, Mar 30 2017 *)
-
Python
from sympy import isprime def G(n): return int(bin(n^(n//2))[2:],2) i=0 j=1 while j<=1281: if G(i)==int(str(G(i))[::-1]) and isprime(G(i))==True: print(j, i) j+=1 i+=1
Comments