cp's OEIS Frontend

This is a front-end for the Online Encyclopedia of Integer Sequences, made by Christian Perfect. The idea is to provide OEIS entries in non-ancient HTML, and then to think about how they're presented visually. The source code is on GitHub.

A281316 Prime number p such that the decimal representation of its binary reflected Gray code is also a prime.

This page as a plain text file.
%I A281316 #17 Jan 08 2025 18:36:49
%S A281316 2,3,5,13,29,41,53,73,113,149,157,173,181,197,229,233,241,293,313,317,
%T A281316 349,373,397,541,557,653,661,673,733,757,769,773,797,809,857,953,977,
%U A281316 1009,1033,1109,1181,1193,1217,1277,1289,1301,1433,1549,1637,1709,1733,1741,1877,1993,2029,2053,2081
%N A281316 Prime number p such that the decimal representation of its binary reflected Gray code is also a prime.
%C A281316 Prime number p such that A003188(p) is in A000040.
%H A281316 Indranil Ghosh, <a href="/A281316/b281316.txt">Table of n, a(n) for n = 1..10000</a>
%e A281316 53 is in the sequence because the decimal representation of its binary reflected Gray code is 47 and both 53 and 47 are primes.
%p A281316 q:= n-> andmap(isprime, [n, Bits[Xor](n, iquo(n, 2))]):
%p A281316 select(q, [$2..3500])[];  # _Alois P. Heinz_, Jan 08 2025
%o A281316 (Python)
%o A281316 from sympy import isprime
%o A281316 def G(n):
%o A281316     return int(bin(n^(n//2))[2:], 2)
%o A281316 i=1
%o A281316 j=1
%o A281316 while j<=10000:
%o A281316     if  isprime(i)==True and isprime(G(i))==True:
%o A281316         print(f"{j} {i}")
%o A281316         j+=1
%o A281316     i+=1
%Y A281316 Cf. A000040, A003188, A281227.
%K A281316 nonn,base
%O A281316 1,1
%A A281316 _Indranil Ghosh_, Jan 20 2017