A373709 Partial sums of A119387.
0, 0, 1, 1, 3, 4, 6, 6, 9, 11, 14, 15, 18, 20, 23, 23, 27, 30, 34, 36, 40, 43, 47, 48, 52, 55, 59, 61, 65, 68, 72, 72, 77, 81, 86, 89, 94, 98, 103, 105, 110, 114, 119, 122, 127, 131, 136, 137, 142, 146, 151, 154, 159, 163, 168, 170, 175, 179, 184, 187, 192
Offset: 0
Links
- Antoine Mathys, Table of n, a(n) for n = 0..9999
- Project Euler, Problem 704 - Factors of Two in Binomial Coefficients.
Programs
-
Maple
a:= proc(n) option remember; `if`(n<0, 0, a(n-1)+ilog2(n+1)-padic[ordp](n+1, 2)) end: seq(a(n), n=0..60); # Alois P. Heinz, Jun 23 2024
-
Mathematica
Accumulate[Table[BitLength[k] - 1 - IntegerExponent[k, 2], {k, 100}]] (* Paolo Xausa, Oct 01 2024 *)
-
PARI
bit_width(n)=logint(n,2)+1; a(n)=my(d=bit_width(n+1),p=hammingweight(n+1));(n+2)*d-2*n-2^d+p-1;