# 'Distributive' property for a function mod m

What properties must some function $f(n)$ have for it to be the case that: $f(n) = (n + 3) \mod m = (n \mod m) + (3 \mod m)$?
Similarly, what if $f(n) = (n + 3) \mod m = (n \mod m + 3)?$

Is this something that is well studied? Where might I go to find more information?

Suppose here that $n,m \in \mathbb{Z^+}$ $-$ {$0$}, that the equation holds for all or some subset of $m,n$ and that 'mod' stands for the standard modular arithmetic operator.

• Welcome to MathSE! You are more likely to get a good answer to your question if you follow a few guidelines. In particular, what have you tried so far, and just where are you stuck? Also, your question needs to be clear. In your case, what do you mean by "mod"? Are you using it as a binary operator to mean the remainder after integer division? You also have no quantifier on $m$: do those functional equations hold for all $m$? – Rory Daulton Jan 12 '15 at 0:44
• Your edit was an improvement. But the equation $f(n)=(n+3) \mod m$ defines $f$ completely but not $m$. Are you asking for properties of $f$ (as you wrote) or properties of $m$ or of $n$? – Rory Daulton Jan 12 '15 at 1:01
• A final question: what is the order of operations in the right side of your first equation? Is it $(n+3)\mod m=(n\mod m)+(3\mod m)$? And how do you define $n\mod m$ when $m$ is zero or negative? What about if $n$ is negative? – Rory Daulton Jan 12 '15 at 1:16
• @Rory sorry I've edited my question to address your concerns. – Max Power Jan 12 '15 at 1:48

Let's assume that $m$ is a positive integer and look at your first equation.
Your equation $(n+3)\mod m=(n\mod m)+(3\mod m)$ is true for all $n$ if $m$ divides $3$: i.e. $m$ is $1$ or $3$. In those cases, both sides of the equation are the same as $n\mod m$: adding the $3$ does nothing.
In all other cases, your equation is not true for all $n$. For $m=2$, use $n=1$. For $m>3$, use $m-3$. In both cases, the left hand side will be zero while the right hand side will be the sum of two non-zero positive integers.