OFFSET
0,5
LINKS
Michael De Vlieger, Table of n, a(n) for n = 0..10000
FORMULA
For n > 1: a(n) = msb(n)/2 = 2^floor(log_2(n)-1) = 2*a(floor(n/2)).
G.f.: 1/(2-2x) * (2x-x^2 + Sum_{k>=1} 2^(k-1)*x^2^k). - Ralf Stephan, Apr 18 2003
MATHEMATICA
lim = 100; CoefficientList[Series[1/(2 - 2 x) (2 x - x^2 + Sum[ 2^(k - 1) x^2^k, {k, Floor@ Log2@ lim}]), {x, 0, lim}], x] (* Michael De Vlieger, Jan 26 2016 *)
PROG
(PARI) a(n)=if(n<2, return(n)); 2^logint(n\2, 2) \\ Charles R Greathouse IV, Jan 26 2016
(Python)
def A072376(n): return n if n < 2 else 1 << n.bit_length()-2 # Chai Wah Wu, Jun 30 2022
CROSSREFS
KEYWORD
easy,nonn
AUTHOR
Henry Bottomley, Jul 19 2002
STATUS
approved