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.

A281382 Numbers n such that the decimal equivalent of the binary reflected Gray code representation of n is a palindromic prime.

Original entry on oeis.org

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

Views

Author

Indranil Ghosh, Jan 21 2017

Keywords

Comments

Numbers n such that A003188(n) is both prime and palindromic.

Examples

			213 is in the sequence because A003188(213) = 191 and 191 is a palindromic prime.
		

Crossrefs

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