The OEIS Foundation is supported by donations from users of the OEIS and by a grant from the Simons Foundation.

 Hints (Greetings from The On-Line Encyclopedia of Integer Sequences!)
 A055945 n - reversal of base 2 digits of n (and then the result is written in base 10). 4

%I

%S 0,0,1,0,3,0,3,0,7,0,5,-2,9,2,7,0,15,0,9,-6,15,0,9,-6,21,6,15,0,21,6,

%T 15,0,31,0,17,-14,27,-4,13,-18,35,4,21,-10,31,0,17,-14,45,14,31,0,41,

%U 10,27,-4,49,18,35,4,45,14,31,0,63,0,33,-30,51,-12,21,-42,63,0,33,-30,51,-12,21,-42,75,12,45,-18,63,0,33,-30,75,12,45

%N n - reversal of base 2 digits of n (and then the result is written in base 10).

%C a(n) is even if n is odd and a(n) is odd if n is even; this is caused by the kind of swapping the most significant and least significant binary digit when reversing n and the fact that the most significant digit of n is always 1. - _R. J. Mathar_, Nov 05 2015

%H Alois P. Heinz, <a href="/A055945/b055945.txt">Table of n, a(n) for n = 0..16384</a>

%H Rémy Sigrist, <a href="/A055945/a055945.png">Colored scatterplot of the first 2^16 terms</a> (where the color is function of n mod 8)

%F For 2^m <= n <= 2^(m+1), we have n - 2^(m+1) <= a(n) <= n. - _N. J. A. Sloane_, May 29 2016

%F a(n) = n - A030101(n).

%p a:= proc(n) local m, r; m:=n; r:=0;

%p while m>0 do r:= r*2 +irem(m, 2, 'm') od;

%p n-r

%p end:

%p seq(a(n), n=0..100); # _Alois P. Heinz_, Jul 02 2015

%t Array[# - IntegerReverse[#, 2] &, 90] (* _Michael De Vlieger_, Sep 06 2019 *)

%Y Cf. A030101, A030109, A265326.

%K base,sign,look

%O 0,5

%A _Henry Bottomley_, Jul 18 2000

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

Last modified January 27 14:39 EST 2020. Contains 331295 sequences. (Running on oeis4.)