Is this expression for $x\pmod n$ interesting; nontrivial?

63 Views Asked by At

For example, we would get several interesting results if we had a formula for $x\pmod n$ that was uniformly convergent, however, according to Wikipedia (Floor and Ceiling Functions) these formulas do not exist because $x\pmod n$ is not continuous. However, as I was playing with the graphs of different functions, I discovered that this one exactly replicates the mod function. $$\frac{n}{2}+\frac{n}{\pi}\arctan\left(\tan\left(\pi\left(\frac{x}{n}-\frac{1}{2}\right)\right)\right).$$ You can see this graph for yourself here.

So is an expression like this where the $\arctan$ and $\tan$ functions should cancel out useful? If so, what are some other examples where this happens?

Added: I realize now that $\arctan(\tan(x))\ne x$, but the general idea of my question still stands: is this function I have interesting?