(abc)%n = (((ab)%n)c)%n = (((ac)%n)b)%n
Means, result is always same even if I apply on each step or once at end.
For Ex. a=3, b=2, c=3, n=5, always gives answer 4.
Why it feels weird to me?
If I assume modulo as clock with numbers from 0-4, we walk on this clock from 0-∞ and always remains on clock. But distance traveled in above cases is very different but still final position is same.
- 36=729 and final position is 4
- 32=9, and 43=64, now distance is 9+64=73, much lesser than previous but final position still 4.
- 33=27, 22=4, here distance is only 31, but final position still 4.
I don't know if I am using this clock process right, but it feels weird and confusing. Can anyone tell me why they gives same result or point me to some resource.