OFFSET
0,3
LINKS
Alois P. Heinz, Table of n, a(n) for n = 0..16384 (first 257 terms from Francois Alcover)
FORMULA
a(n) = max(n,A030101(n)).
EXAMPLE
a(10) = max(10, r(10))
= max(10, b'0101')
= max(10, 5)
= 10.
a(11) = max(11, r(11))
= max(11, b'1101')
= max(11, 13)
= 13.
MAPLE
a:= proc(n) local m, r; m:=n; r:=0;
while m>0 do r:=r*2+irem(m, 2, 'm') od;
max(n, r)
end:
seq(a(n), n=0..127); # Alois P. Heinz, Apr 23 2019
PROG
(PARI) a(n) = max(n, fromdigits(Vecrev(binary(n)), 2)); \\ Michel Marcus, Apr 24 2019
CROSSREFS
KEYWORD
AUTHOR
Francois Alcover, Apr 23 2019
STATUS
approved