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
KEYWORD
nonn
AUTHOR
STATUS
approved