OFFSET
1,1
LINKS
Indranil Ghosh, Table of n, a(n) for n = 1..10000
EXAMPLE
53 is in the sequence because the decimal representation of its binary reflected Gray code is 47 and both 53 and 47 are primes.
MAPLE
q:= n-> andmap(isprime, [n, Bits[Xor](n, iquo(n, 2))]):
select(q, [$2..3500])[]; # Alois P. Heinz, Jan 08 2025
PROG
(Python)
from sympy import isprime
def G(n):
return int(bin(n^(n//2))[2:], 2)
i=1
j=1
while j<=10000:
if isprime(i)==True and isprime(G(i))==True:
print(f"{j} {i}")
j+=1
i+=1
CROSSREFS
KEYWORD
nonn,base
AUTHOR
Indranil Ghosh, Jan 20 2017
STATUS
approved
