Hello,

I just need to know if this holds :

$\displaystyle

a^b \equiv a^{b \mod \varphi{(n)}} \pmod{n}

$ For any $\displaystyle a$ coprime with $\displaystyle n$.

I know this is true but what about this :

$\displaystyle

a^{\left ( b^c \right )} \equiv a^{\left ( b^{c \mod \varphi{(\varphi{(n)})}} \right )} \pmod{n}

$ For any $\displaystyle a$ coprime with $\displaystyle n$.

This would seem to work intuitively but I'm having trouble proving or disproving it (all my tests seem to fail for some reason but not because of the math).

Thank you all