I've been working on a problem and hope someone can help me with this (probably this has already been studied, I don't know). For a given a and to numbers m and n, are there any special conditions for the equality
(a (mod m))(mod n)=(a (mod n))(mod m)
to hold? I've been trying to come up with something, but until now I have no clue. Can anyone please help me with this?
Thanks!!
Yes there is. Without loss of generality you can assume 'n smaller than m' (if they are the same the equality holds). Hence (a (mod n))(mod m)= a (mod n). Now the equality holds iff 'a=n*m*x+y' with 'x' and 'y' are natural numbers and 'y smaller than m' holds, meaning '(int) a/m' is a multiple of 'n'.