Theory Of Numbers
Example:
Let A=14, B=17, C=5
Let's verify: (A + B) mod C = (A mod C + B mod C) mod C
LHS = Left Hand Side of the Equation
RHS = Right Hand Side of the Equation
LHS = (A + B) mod C
LHS = (14 + 17) mod 5
LHS = 31 mod 5
LHS = 1
RHS = (A mod C + B mod C) mod C
RHS = (14 mod 5 + 17 mod 5) mod 5
RHS = (4 + 2) mod 5
RHS = 1
LHS = RHS = 1
Visualisation of Modular addition:
The same concept is used while subtracting the modular expressions.
The same concept is used while multiplying the modular expressions.
Source : KhanAcademy.com