The question is to find out $2005^{2007^{2009}}\bmod 7$ or the remainder when $2005^{2007^{2009}}$ is divided by $7$. My steps $: \\ 2005\equiv3\pmod 7\\ 2005^3\equiv3^3\equiv-1\pmod7\\ 2005^{2007}\equiv-1^{669}\equiv-1\pmod7$
How do I proceed? Please help!!!
As $2005$ is not divisible by $7$ – more precisely, $2005\equiv 3\bmod 7$, you can use lil' Fermat: $$2005^{2007^{2009}}\equiv 3^{2007^{2009}}\equiv 3^{2007^{2009}\bmod 6}\mod 7.$$ Now $\;2007\equiv 3\mod 6$, and it happens that, for all $n$, $3^n\equiv 3\mod 6$, so that $$2005^{2007^{2009}}\equiv 3^3\mod 7.$$