In the Miller-Rabin test for prime numbers, there is a congruence in the form of $a^{n-1} ≡ 1$ (mod $n$).
I'm curious as to how $1$ modulo $n$ cannot just be written as $n$? And the left side expressed as the remainder of the integer division or something? Or can it?
Modulus is like a remainder. So what that is saying is that $\frac{a^{n-1}}{ n}$ has a remainder of 1. For example, $5 ≡ 1$ (mod 4) also $9 ≡ 1$(mod 4). $n$ would not be an answer to that, because $n≡0$ (mod n).