login
A030411
a(n)=(# 1's)-(# 0's) in first n terms of A030401.
0
1, 1, 2, 3, 4, 4, 4, 5, 5, 5, 5, 6, 6, 6, 7, 6, 7, 8, 7, 7, 8, 9, 10, 11, 12, 12, 13, 13, 14, 15, 15, 15, 16, 16, 17, 18, 18, 18, 18, 17, 18, 18, 17, 17, 17, 18, 19, 19, 20, 20, 20, 20, 21, 21, 21, 21, 21, 21, 22, 22, 22, 22, 22, 21, 22, 22, 21, 21
OFFSET
1,3
MATHEMATICA
Accumulate[Which[#==1, 1, #==0, -1, True, 0]&/@Flatten[Array[IntegerDigits[2 #-1, 4]&, 40]]] (* Harvey P. Dale, Oct 15 2023 *)
CROSSREFS
Sequence in context: A130242 A130245 A087793 * A194817 A211675 A239683
KEYWORD
nonn
STATUS
approved