A030601 a(n)=(# 1's)-(# 0's) in first n terms of A030588.
1, 1, 1, 2, 3, 4, 4, 5, 5, 5, 6, 6, 6, 6, 6, 6, 7, 7, 7, 7, 7, 7, 8, 8, 8, 8, 8, 8, 9, 9, 9, 9, 9, 10, 9, 10, 11, 10, 10, 11, 10, 10, 11, 12, 13, 14, 15, 15, 16, 17, 17, 18, 18, 19, 20, 20, 20, 21, 21, 21, 22, 22, 23, 24, 24, 24, 25, 25, 25, 26, 26, 27
Offset: 1
Keywords
Programs
-
Mathematica
Accumulate[Which[#==1,1,#==0,-1,True,0]&/@Flatten[Table[ IntegerDigits[ 2n-1,6],{n,50}]]] (* Harvey P. Dale, Jan 30 2015 *)