A089398 a(n) = n-th column sum of binary digits of k*2^(k-1), where summation is over k>=1, without carrying between columns.
1, 0, 2, 1, 1, 1, 3, 2, 2, 0, 3, 2, 2, 2, 4, 3, 3, 1, 2, 2, 2, 2, 4, 3, 3, 1, 4, 3, 3, 3, 5, 4, 4, 2, 3, 1, 2, 2, 4, 3, 3, 1, 4, 3, 3, 3, 5, 4, 4, 2, 3, 3, 3, 3, 5, 4, 4, 2, 5, 4, 4, 4, 6, 5, 5, 3, 4, 2, 1, 2, 4, 3, 3, 1, 4, 3, 3, 3, 5, 4, 4, 2, 3, 3, 3, 3, 5, 4, 4, 2, 5, 4, 4, 4, 6, 5, 5, 3, 4, 2, 3, 3, 5, 4, 4
Offset: 1
Examples
Binary expansions of k*2^(k-1), with bits in ascending order by powers of 2, are: 1 001 0011 000001 0000101 00000011 000000111 00000000001 000000001001 0000000000101 00000000001101 000000000000011 0000000000001011 ................. Giving column sums: 10211132203222433...
Programs
-
Mathematica
f[n_] := Block[{lg = Floor[Log[2, n]] + 1}, Sum[ Join[ Reverse[ IntegerDigits[n - i + 1, 2]], {0}][[i]], {i, lg}]]; Table[ f[n], {n, 105}] (* Robert G. Wilson v, Mar 26 2005 *)
Comments