Modular Arithmetic
Modular arithmetic - Wikipedia
# Congruence
Congruence modulo (article) | Cryptography | Khan Academy
$A \equiv B \pmod{C}$
- $\equiv$ is the symbol for congruence, which means the values A and B are in the same equivalence class.
- (mod C) tells us what operation we applied to A and B.
- when we have both of these, we call $\equiv$ congruence modulo C.
We say that r is congruent to s modulo n, or r is congruent to s mod n, if r − s is evenly divisible by n;
# From Set
# Modular Power
Complexity: $O(log(y))$ for $x^y$
Use Divide and Conquer Algorithm, $x^{y}=(x^{\lfloor{y/2}\rfloor})^{2}$, like fast multiply algorithm.