A030584 (# 3's)-(# 4's) in first n terms of A030567.
0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0, 1, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 1, 0, 0, 0, 0, 0, 1, 1, 2, 2, 3, 4, 5, 4, 5, 5, 6, 6, 5, 5, 4, 4, 3, 4, 3, 2, 1, 1, 0, 0, 0, 0, 0, 0, 0, 1, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 1, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0
Offset: 1
Keywords
Programs
-
Mathematica
Accumulate[Which[#==3,1,#==4,-1,True,0]&/@Flatten[Table[Reverse[IntegerDigits[n,6]],{n,50}]]] (* Harvey P. Dale, Aug 07 2025 *)