I was trying to find some function in terms of exponentials and basic arithmetic that satisfies: $$f(n) = n \bmod 10$$
It's very easy to find such an $f$ for $\bmod 2$, so I started trying to express $n \bmod 10$ in terms of lower divisors. Turns out it was extremely easy to come up with the following: $$n \bmod 10 =n \bmod 5 +5((n -(n \bmod 5)) \bmod 2)$$ using this equation: $$5j + (n \bmod 5) = 10k +(n \bmod 10)$$ because $j$ and $k$ are related in the following way: $$2k = j - (j \bmod 2)$$ and $$j = \frac{n - (n \bmod 5)}{5}$$
So now the goal is to find an expression of $n \bmod 5$ in terms of any lower divisor (or any higher one, if it can easily be split). $n \bmod 4$ could easily be split the same way as $10$, but I think it may be impossible to simplify $n \bmod p$, where $p$ is prime.