login
A281382
Numbers n such that the decimal equivalent of the binary reflected Gray code representation of n is a palindromic prime.
2
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,1
COMMENTS
Numbers n such that A003188(n) is both prime and palindromic.
LINKS
Indranil Ghosh and Chai Wah Wu, Table of n, a(n) for n = 1..13824, first 1281 terms from Indranil Ghosh.
EXAMPLE
213 is in the sequence because A003188(213) = 191 and 191 is a palindromic prime.
MATHEMATICA
Select[Range@ 30000, And[PrimeQ@ #, Reverse@ # == # &@ IntegerDigits@ #] &@ BitXor[#, Floor[#/2]] &] (* Michael De Vlieger, Mar 30 2017 *)
PROG
(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 str(j)+" "+str(i)
........j+=1
....i+=1
CROSSREFS
Sequence in context: A075371 A218948 A057704 * A078203 A285937 A253647
KEYWORD
nonn,base
AUTHOR
Indranil Ghosh, Jan 21 2017
STATUS
approved