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

%I #7 Jan 22 2017 21:50:37

%S 0,1,2,5,6,10,14,18,21,25,30,34,42,54,62,66,77,85,90,102,105,113,126,

%T 130,146,170,186,198,214,238,254,258,285,301,306,330,341,357,378,390,

%U 409,425,438,462,465,481,510,514,546,594,626,650,682,730,762,774,806,854,886,910,942

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

%C A281378 is a subsequence of this sequence.

%H Indranil Ghosh, <a href="/A281379/b281379.txt">Table of n, a(n) for n = 1..10000</a>

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

%t Select[Range[0, 10^3], Reverse@ # == # &@ Abs[Prepend[Most@ #, 0] - #] &@

%t IntegerDigits[#, 2] &] (* _Michael De Vlieger_, Jan 21 2017 *)

%o (Python)

%o def G(n):

%o ....return bin(n^(n/2))[2:]

%o i=0

%o j=1

%o while j<=10000:

%o ....if G(i)==G(i)[::-1]:

%o ........print str(j)+" "+str(i)

%o ........j+=1

%o ....i+=1

%Y Cf. A006995, A014550, A281378.

%K nonn,base

%O 1,3

%A _Indranil Ghosh_, Jan 21 2017