login
A030349
(# 1's)-(# 0's) in first n terms of A030341.
0
1, 1, 0, 1, 2, 3, 3, 4, 3, 3, 4, 4, 4, 4, 3, 2, 3, 4, 3, 4, 4, 3, 4, 3, 4, 5, 6, 7, 8, 8, 9, 10, 9, 9, 10, 11, 11, 12, 12, 12, 13, 12, 11, 11, 12, 11, 11, 11, 10, 10, 9, 10, 10, 11, 12, 12, 12, 13, 13, 12, 12, 12, 13, 13, 13, 13, 13, 13, 12, 11, 10, 11
OFFSET
1,5
MATHEMATICA
Accumulate[Which[#==1, 1, #==0, -1, True, 0]&/@Flatten[Table[Reverse[IntegerDigits[n, 3]], {n, 40}]]] (* Harvey P. Dale, Jul 25 2024 *)
CROSSREFS
Sequence in context: A077603 A077567 A096344 * A285203 A085887 A305716
KEYWORD
nonn
STATUS
approved