EDIT: Pasting into Lynx screwed formatting from Groff.
That is not generally true. A quick counterexample:
a = 2, n = 3, b = 5 2^3 % 5 = 8 % 5 = 3 2 % 5 = 2 3 != 2
(a ^ n) % n = a % n
That is not generally true. A quick counterexample: