Working Modulo n
Tip
Congruence arithmetic
means . You may add, subtract, and multiply congruences.
In plain terms. Only the remainder matters, so replace big numbers by their remainders and do easy arithmetic.
Example. : since , .
Tip
Fermat's little theorem
If is prime and , then .
In plain terms. Raising to the power resets you to modulo a prime, so huge exponents shrink fast.
Example. : , and , so .