OFFSET
1,2
LINKS
Robert Israel, Table of n, a(n) for n = 1..10000
EXAMPLE
The sequence of fractions begins: 1, 2, 3/2, 3, 2, 5/2, 2, 4, 5/2, 3, 7/3, 7/2, 8/3, 3, 5/2, 5, 3, 7/2, 8/3, 4.
For example, the reversed binary expansion of 18 is (0,1,0,0,1), and the average of {2,5} is 7/2, so a(18) = 7.
MAPLE
f:= proc(n) local L;
L:= convert(n, base, 2);
L:= select(t -> L[t]=1, [$1..nops(L)]);
numer(convert(L, `+`)/nops(L))
end proc:
map(f, [$1..100]); # Robert Israel, Oct 07 2019
MATHEMATICA
Table[Numerator[Mean[Join@@Position[Reverse[IntegerDigits[n, 2]], 1]]], {n, 100}]
CROSSREFS
KEYWORD
AUTHOR
Gus Wiseman, Jul 20 2019
STATUS
approved