Are you trying to make an equation that takes in an a-value and outputs a x-value?
Something like *f(a,x)=x+floor(a/b)* will output *x*+1 for every time *a* increased by by *b*. It doesn’t “loop” *a* back through 0, but does the same thing to *x*
Not sure if that totally addresses your question, but feel free to clarify what you’re trying to achieve. More context about why you’ve picked your numbers, and why things are acting the way you describe would be helpful.