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.

A281379 Numbers which are palindromic in their binary reflected Gray code representation.

Original entry on oeis.org

0, 1, 2, 5, 6, 10, 14, 18, 21, 25, 30, 34, 42, 54, 62, 66, 77, 85, 90, 102, 105, 113, 126, 130, 146, 170, 186, 198, 214, 238, 254, 258, 285, 301, 306, 330, 341, 357, 378, 390, 409, 425, 438, 462, 465, 481, 510, 514, 546, 594, 626, 650, 682, 730, 762, 774, 806, 854, 886, 910, 942
Offset: 1

Views

Author

Indranil Ghosh, Jan 21 2017

Keywords

Comments

A281378 is a subsequence of this sequence.

Examples

			34 is in the sequence because the binary reflected Gray code representation of 34 is '110011', which is palindromic.
		

Crossrefs

Programs

  • Mathematica
    Select[Range[0, 10^3], Reverse@ # == # &@ Abs[Prepend[Most@ #, 0] - #] &@
    IntegerDigits[#, 2] &] (* Michael De Vlieger, Jan 21 2017 *)
  • Python
    def G(n):
        return bin(n^(n//2))[2:]
    i=0
    j=1
    while j<=10000:
        if G(i)==G(i)[::-1]:
            print(str(j)+" "+str(i))
            j+=1
        i+=1