-1

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!!

liwuen
  • 330
  • 2
  • 17
  • I'm voting to close this question as off-topic because it is about [math.se] instead of programming or software development. – Pang Feb 19 '16 at 02:28

1 Answers1

1

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'.

ctst
  • 1,610
  • 1
  • 13
  • 28