login
The OEIS is supported by the many generous donors to the OEIS Foundation.

 

Logo
Hints
(Greetings from The On-Line Encyclopedia of Integer Sequences!)
A281378 Palindromic numbers which are also palindromic in their binary reflected Gray code representation. 2

%I #21 Mar 01 2020 07:17:40

%S 0,1,2,5,6,66,77,626,5005,7777,22122,64446,87978,399993,1287821,

%T 5614165,5679765,6407046,6865686,7107017,8349438,8547458,282777282,

%U 1220330221,43474247434,43833533834,64630703646,68622322686,73855855837,1249451549421,2468208028642

%N Palindromic numbers which are also palindromic in their binary reflected Gray code representation.

%H Chai Wah Wu, <a href="/A281378/b281378.txt">Table of n, a(n) for n = 1..47</a>

%e 626 is in the sequence because binary reflected Gray code for 626 is '1101001011' and both 626 and '1101001011' are palindromics.

%t Select[Range[10^7], And[Reverse@ # == # &@ IntegerDigits@ #, Reverse@ # == # &@ Abs[Prepend[Most@ #, 0] - #] &@ IntegerDigits[#, 2]] &] (* _Michael De Vlieger_, Jan 21 2017 *)

%o (Python)

%o def G(n):

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

%o i=1

%o j=1

%o while j<=23:

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

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

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

%o ....i+=1

%o (PARI) lista(nn) = {my(v, w); for(k=0, nn, if((w=digits(k))==Vecrev(w) && (v=binary(bitxor(k, k>>1)))==Vecrev(v), print1(k, ", "))); } \\ _Jinyuan Wang_, Mar 01 2020

%Y Cf. A002113, A006995, A014550, A281379.

%K nonn,base

%O 1,3

%A _Indranil Ghosh_, Jan 20 2017

%E 0 and more terms added by _Chai Wah Wu_, Jan 23 2017

Lookup | Welcome | Wiki | Register | Music | Plot 2 | Demos | Index | Browse | More | WebCam
Contribute new seq. or comment | Format | Style Sheet | Transforms | Superseeker | Recents
The OEIS Community | Maintained by The OEIS Foundation Inc.

License Agreements, Terms of Use, Privacy Policy. .

Last modified July 30 03:11 EDT 2024. Contains 374734 sequences. (Running on oeis4.)