The OEIS mourns the passing of Jim Simons and is grateful to the Simons Foundation for its support of research in many branches of science, including the OEIS.
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!)
A295513 a(n) = n*bil(n) - 2^bil(n) where bil(0) = 0 and bil(n) = floor(log_2(n)) + 1 for n>0. 1

%I #20 Mar 30 2023 02:01:06

%S -1,-1,0,2,4,7,10,13,16,20,24,28,32,36,40,44,48,53,58,63,68,73,78,83,

%T 88,93,98,103,108,113,118,123,128,134,140,146,152,158,164,170,176,182,

%U 188,194,200,206,212,218,224,230,236,242,248,254,260,266,272,278

%N a(n) = n*bil(n) - 2^bil(n) where bil(0) = 0 and bil(n) = floor(log_2(n)) + 1 for n>0.

%H Hsien-Kuei Hwang, S. Janson, and T.-H. Tsai, <a href="http://140.109.74.92/hk/wp-content/files/2016/12/aat-hhrr-1.pdf">Exact and asymptotic solutions of the recurrence f(n) = f(floor(n/2)) + f(ceiling(n/2)) + g(n): theory and applications</a>, Preprint 2016.

%F A001855(n) = a(n) + 1.

%F A033156(n) = a(n) + 2n.

%F A003314(n) = a(n) + n.

%F A083652(n) = a(n+1) + 2.

%F A061168(n) = a(n+1) - n + 1.

%F A123753(n) = a(n+1) + n + 2.

%F A097383(n) = a(n+1) - div(n-1, 2).

%F A054248(n) = a(n) + n + rem(n, 2).

%p A295513 := proc(n) local i, s, z; s := -1; i := n-1; z := 1;

%p while 0 <= i do s := s+i; i := i-z; z := z+z od; s end:

%p seq(A295513(n), n=0..57);

%t a[n_] := n IntegerLength[n, 2] - 2^IntegerLength[n, 2];

%t Table[a[n], {n, 0, 58}]

%o (Python)

%o def A295513(n): return n*(m:=(n-1).bit_length())-(1<<m) if n else -1 # _Chai Wah Wu_, Mar 29 2023

%Y Cf. A001855, A003314, A033156, A054248, A061168, A083652, A097383, A123753, A295508.

%K sign

%O 0,4

%A _Peter Luschny_, Dec 02 2017

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 May 14 23:22 EDT 2024. Contains 372535 sequences. (Running on oeis4.)