|
|
A055945
|
|
a(n) = n - (reversal of base-2 digits of n) (and then the result is written in base 10).
|
|
6
|
|
|
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, 15, 0, 31, 0, 17, -14, 27, -4, 13, -18, 35, 4, 21, -10, 31, 0, 17, -14, 45, 14, 31, 0, 41, 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
(list;
graph;
refs;
listen;
history;
text;
internal format)
|
|
|
OFFSET
|
0,5
|
|
COMMENTS
|
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
|
|
LINKS
|
|
|
FORMULA
|
For 2^m <= n <= 2^(m+1), we have n - 2^(m+1) <= a(n) <= n. - N. J. A. Sloane, May 29 2016
|
|
MAPLE
|
a:= proc(n) local m, r; m:=n; r:=0;
while m>0 do r:= r*2 +irem(m, 2, 'm') od;
n-r
end:
|
|
MATHEMATICA
|
|
|
CROSSREFS
|
|
|
KEYWORD
|
|
|
AUTHOR
|
|
|
STATUS
|
approved
|
|
|
|