cp's OEIS Frontend

This is a front-end for the Online Encyclopedia of Integer Sequences, made by Christian Perfect. The idea is to provide OEIS entries in non-ancient HTML, and then to think about how they're presented visually. The source code is on GitHub.

A072376 a(n) = a(floor(n/2)) + a(floor(n/4)) + a(floor(n/8)) + ... starting with a(0)=0 and a(1)=1.

This page as a plain text file.
%I A072376 #18 Jul 01 2022 05:33:25
%S A072376 0,1,1,1,2,2,2,2,4,4,4,4,4,4,4,4,8,8,8,8,8,8,8,8,8,8,8,8,8,8,8,8,16,
%T A072376 16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,
%U A072376 16,16,16,16,16,16,16,16,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32
%N A072376 a(n) = a(floor(n/2)) + a(floor(n/4)) + a(floor(n/8)) + ... starting with a(0)=0 and a(1)=1.
%H A072376 Michael De Vlieger, <a href="/A072376/b072376.txt">Table of n, a(n) for n = 0..10000</a>
%F A072376 For n > 1: a(n) = msb(n)/2 = 2^floor(log_2(n)-1) = 2*a(floor(n/2)).
%F A072376 G.f.: 1/(2-2x) * (2x-x^2 + Sum_{k>=1} 2^(k-1)*x^2^k). - _Ralf Stephan_, Apr 18 2003
%t A072376 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 *)
%o A072376 (PARI) a(n)=if(n<2, return(n)); 2^logint(n\2,2) \\ _Charles R Greathouse IV_, Jan 26 2016
%o A072376 (Python)
%o A072376 def A072376(n): return n if n < 2 else 1 << n.bit_length()-2 # _Chai Wah Wu_, Jun 30 2022
%Y A072376 Cf. A011782, A022825, A053644, A062383.
%K A072376 easy,nonn
%O A072376 0,5
%A A072376 _Henry Bottomley_, Jul 19 2002