I need to predict offsetn and (S/dn), let's call the later dsn, and I cannot guarantee than k is fixed for all n.
I mostly need to predict offset n (probably?)
I feel like the math part should speak for itself, so I don't know how to present it better. If I give more context, people get hung up on the extra details I don't want or need to solve.
But basically it's for a kind of raytracing in wrapping space, with a lot of extra abstraction leap to get to that specific point. With the extra requirement to avoid for loop at all cost for a fixed length solution, non negotiable.
If you really want the extra details, here is a recount of my journey to here:
https://forum.unity.com/threads/infinite-parallax-hair-volume-using-wrapping-grid-tracing-attempt.593233/