A030323 Number of 1's minus number of 0's in first n terms of A030317.
1, 2, 3, 4, 3, 4, 5, 6, 7, 8, 7, 6, 7, 8, 7, 8, 9, 10, 11, 10, 11, 12, 13, 14, 15, 16, 15, 14, 13, 14, 15, 14, 13, 14, 15, 16, 15, 16, 15, 16, 17, 16, 17, 18, 19, 20, 21, 20, 19, 20, 21, 22, 21, 22, 23, 24, 25, 26, 25, 26, 27, 28, 29, 30, 31, 32
Offset: 1
Programs
-
Mathematica
Accumulate[Flatten[Table[IntegerDigits[2n - 1, 2], {n, 50}]] /. 0 -> -1] (* Alonso del Arte, Feb 16 2020 *)
Extensions
Name clarified by Alonso del Arte, Feb 10 2020