It occurs to me that I didn't think about one final element of this formula.

I wonder if it's possible to restart from 10 whenever the counter reaches 0?