I am trying to simplify an expression I've found that is related to converting from a number base to another:
$$n\,\mathrm{ mod }\,b^{k+1} - (n\,\mathrm{ mod }\,b^{k+1})\,\mathrm{ mod }\, b^k$$
In this sense I mainly want to simplify the second term. I know, for instance, about the identity
$$(a\,\mathrm{ mod }\,b)\,\mathrm{ mod }\,b = a\,\mathrm{ mod }\,b$$
But I don't know if it could actually help.
$n \text{ mod } b^{k+1} = r$
means $n = q b^{k+1} + r = (qb)b^k+r$ that is $n \text{ mod } b^k = r \text{ mod } b^k$
Thus $(n\,\mathrm{ mod }\,b^{k+1})\,\mathrm{ mod }\, b^k = n\text{ mod } b^k$