<s>[INST] How to prove that if $a\equiv b \pmod{kn}$ then $a^k\equiv b^k \pmod{k^2n}$ What I have done is this:
$a\equiv b \pmod{2n}$,
$a=b+c\times2n$, for some $c$,
$a^2=b^2+2b\times c\times2n+c^2\times2^2n^2$,
$a^2-b^2=(b\times c+c^2n)\times4n$, then
$a^2\equiv b^2\pmod{2^2n}$.
I think that this is right: what I DON’T understand is how to generalize this to:
$a\equiv b\pmod{kn}\Rightarrow a^k\equiv b^k \pmod{k^2n}$.
Please give me a hint.
 [/INST] Since 
$a^k-b^k=(a-b)(a^{k-1}+a^{k-2}b+\ldots b^{k-1})$
we need only prove that 
$a^{k-1}+a^{k-2}b+\ldots + b^{k-1}$ is divisible by $k$. But since $a \equiv b \ (\text{mod} \ k)$ we see that 
$ a^{k-1}+a^{k-2}b+\ldots + b^{k-1} \equiv a^{k-1}+a^{k-1}+\ldots +a^{k-1} \equiv ka^{k-1} \equiv 0 \ (\text{mod} \ k). $ 
</s>