OFFSET
1,2
COMMENTS
a(n) is even if and only if n is in A062880. - Robert Israel, Oct 13 2020
LINKS
Robert Israel, Table of n, a(n) for n = 1..10000
FORMULA
Trivially, a(n) <= log_2(n). - Charles R Greathouse IV, Nov 15 2022
EXAMPLE
The reversed binary expansion of 40 is (0,0,0,1,0,1), with positions of 1's being {4,6}, so a(40) = GCD(4,6) = 2.
MAPLE
f:= proc(n) local B;
B:= convert(n, base, 2);
igcd(op(select(t -> B[t]=1, [$1..ilog2(n)+1])))
end proc:
map(f, [$1..100]); # Robert Israel, Oct 13 2020
MATHEMATICA
Table[GCD@@Join@@Position[Reverse[IntegerDigits[n, 2]], 1], {n, 100}]
CROSSREFS
KEYWORD
nonn,base
AUTHOR
Gus Wiseman, Jul 17 2019
STATUS
approved