Given X=11 and Y=3.
The modulo operation XmodY gives the remainder when dividing X by Y.
11÷3=3 with remainder 2
So 11mod3=2
Testing (11+a×3)mod3 for different values of a:
For a=1:
(11+1×3)mod3
=14mod3
=2
For a=2:
(11+2×3)mod3
=17mod3
=2
For a=0:
(11+0×3)mod3
=11mod3
=2
For a=−1:
(11+(−1)×3)mod3
=8mod3
=2
Adding any multiple of Y to X does not change the remainder when dividing by Y.
Since aY is a multiple of Y:
aYmodY=0
Therefore:
(X+aY)modY
=(XmodY+aYmodY)modY
=(XmodY+0)modY
=XmodY
This holds for all integers a (positive, negative, or zero).
The equation XmodY=(X+aY)modY holds for all integral values of a.