OFFSET
1,7
MATHEMATICA
Accumulate[Which[#==1, 1, #==2, -1, True, 0]&/@(Reverse[IntegerDigits[ #, 5]]&/@ Range[ 0, 40]//Flatten)] (* Harvey P. Dale, Aug 02 2016 *)
CROSSREFS
KEYWORD
nonn
AUTHOR
STATUS
approved