login
The OEIS is supported by the many generous donors to the OEIS Foundation.

 

Logo
Hints
(Greetings from The On-Line Encyclopedia of Integer Sequences!)
A113473 n repeated 2^(n-1) times. 14

%I #30 Oct 14 2022 16:05:51

%S 1,2,2,3,3,3,3,4,4,4,4,4,4,4,4,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5,6,6,6,

%T 6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,7,7,7,7,7,

%U 7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7

%N n repeated 2^(n-1) times.

%F a(1) = 1; for n>1 a(n) = a(floor(n/2)) + 1.

%F a(n) = floor(log_2(2n)).

%F It appears that a(n) = Sum_{k=0..n-1} (1-(-1)^A000108(k))/2. - _Paul Barry_, Mar 31 2008

%F a(n) = A070939(n) if n>0. - _R. J. Mathar_, Aug 13 2008

%F a(n) = A029837(n+1) = 1 + floor(log_2(n)) if n>0. - _Michael Somos_, Jun 02 2019

%e G.f. = x + 2*x^2 + 2*x^3 + 3*x^4 + 3*x^5 + 3*x^6 + 3*x^7 + 4*x^8 + ... - _Michael Somos_, Jun 02 2019

%t a[ n_] := If[ n < 1, 0, BitLength[n]]; (* _Michael Somos_, Jun 02 2019 *)

%o (PARI) for(n=1,9,for(i=1,1<<(n-1),print1(n", "))) \\ _Charles R Greathouse IV_, Jun 11 2011

%o (PARI) {a(n) = if( n<1, 0, exponent(n)+1)}; /* _Michael Somos_, Jun 02 2019 */

%o (Python)

%o def A113473(n): return n.bit_length() # _Chai Wah Wu_, Oct 14 2022

%Y Cf. A029837, A070939.

%Y Partial sums of A036987.

%K nonn,easy

%O 1,2

%A _Zak Seidov_, Jan 08 2006

Lookup | Welcome | Wiki | Register | Music | Plot 2 | Demos | Index | Browse | More | WebCam
Contribute new seq. or comment | Format | Style Sheet | Transforms | Superseeker | Recents
The OEIS Community | Maintained by The OEIS Foundation Inc.

License Agreements, Terms of Use, Privacy Policy. .

Last modified April 24 00:30 EDT 2024. Contains 371917 sequences. (Running on oeis4.)