login
A281227
Primes whose binary reflected Gray code representation is also the decimal representation of a prime.
2
2, 53, 233, 281, 397, 521, 613, 673, 733, 773, 797, 829, 1049, 1129, 1433, 1553, 1697, 1933, 2129, 2237, 2273, 2281, 2437, 2521, 2557, 2617, 2729, 2969, 3121, 3181, 3413, 3457, 3517, 3637, 3709, 3761, 3881, 4337, 4357, 4729, 4733, 4877, 4889, 5101, 5657, 5813, 5857, 6113, 6133
OFFSET
1,1
LINKS
EXAMPLE
521 is in the sequence because 521_10 = 1100001101_2 and both 521 and 1100001101 are prime numbers in base 10.
PROG
(Python)
from sympy import isprime
def gray(n):
....return bin(n^(n/2))[2:]
i=1
j=1
while j<=481:
....if isprime(i)==True and isprime(int(gray(i)))==True:
........print str(j)+" "+str(i)
........j+=1
....i+=1
CROSSREFS
KEYWORD
nonn,base
AUTHOR
Indranil Ghosh, Jan 18 2017
STATUS
approved