I need to prove that for any positive integers $a$, $b$, $c$ and $k$ the statement
$(a^b\bmod k)^c \bmod k = \left(a^b\right)^c\bmod k$
is always correct (I think it is).
I know very little of modular arithmetic so I please be gentle with me.
I need to prove that for any positive integers $a$, $b$, $c$ and $k$ the statement
$(a^b\bmod k)^c \bmod k = \left(a^b\right)^c\bmod k$
is always correct (I think it is).
I know very little of modular arithmetic so I please be gentle with me.
Let's use the definition: $a^b = kv + r \implies a^b = r \mod k$. So we have: $$\begin{align} (a^b)^c &= (kv + r)^c \\ &= c-1\; \text{terms with powers of $k$} + r^c \end{align}$$ Reduce that modulo $k$ to get $(a^b)^c = r^c \mod k$. And I let you see how to finish it up.