A030566 a(n)=(# 4's)-(# 5's) in first n terms of A030548.
0, 0, 0, 1, 0, 0, 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, 0, 0, 0, 0, 0, 1, 1, 0, 1, 1, 2, 2, 3, 3, 4, 4, 5, 6, 7, 6, 5, 5, 4, 4, 3, 3, 2, 2, 1, 2, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 1, 1, 0, 0, 0, 0, 0, 0, 0, 0
Offset: 1
Keywords
Programs
-
Mathematica
Accumulate[Which[#==4,1,#==5,-1,True,0]&/@Flatten[Table[IntegerDigits[n,6],{n,50}]]] (* Harvey P. Dale, Feb 26 2025 *)
Comments