It is known that $(a + b) \bmod n = [(a \bmod n) + (b \bmod n)] \bmod n$, but is it possible that the following are also true?
- $(a + b) \bmod n = [(a \bmod n) + b] \bmod n$
- $(a + b) \bmod n = [a + (b \bmod n)] \bmod n$
I've been trying all sorts of tests/combinations (of positive integers, mind you) and it always seems to work. For example, with $a = 7, b = 8, n = 6$:
- $(7 + 8) \bmod 6 = 15 \bmod 6 = 3$
- $[(7 \bmod 6) + 8] \bmod 6 = [1 + 8] \bmod 6 = 9 \bmod 6 = 3$
- $[7 + (8 \bmod 6)] \bmod 6 = [7 + 2] \bmod 6 = 9 \bmod 6 = 3$
- $[(7 \bmod 6) + (8 \bmod 6)] \bmod 6 = [1 + 2] \bmod 6 = 3 \bmod 6 = 3$
I've tried it with a dozen different combinations and it always works out. What I would love to know is: am I wrong? If so, is there a good counter-example? If not, how could the veracity of this property be explained/proved, and how come it never shows up in the usual definition of the distributive property of modulo? It's really bugging me, because I'm sure I'm right, but I can't for the life of me find any documentation on this and/or properly demonstrate my case.
Thanks!