TITLE: Find last 3 digits of $ 2032^{2031^{2030^{\dots^{2^{1}}}}}$
QUESTION [8 upvotes]: Find the last 3 digits of this number
$$
2032^{2031^{2030^{\dots^{2^{1}}}}}
$$
So obviously we are looking for $x$ so that
$$
2032^{2031^{2030^{\dots^{2^{1}}}}} \equiv x \quad \text{mod}\hspace{0.1cm} 1000
$$ 
I also know that usually you use Euler' theorem here, but that only works when the numbers $a$ and $n$ are coprime, but $2032$ and $1000$ are not coprime? I can easily find $\varphi(1000)$, that is not a problem. Am I looking for wrong numbers to be coprime here or is there another way instead of Euler' theorem?

REPLY [3 votes]: Don't be scared.  If it turns into a monster and eats you, run away after you throw stones at it.  Don't run away before throwing stones just because it looks like a monster.
$2032^{monster}$ and $1000$ are relatively prime so we can't use Euler theorem but we can break it down with Chinese remainder theorem.
$2032^{monster} = 0 \pmod 8$ and so we just need to solve $2032^{monster} \pmod {125}$ and for that we can use Euler Theorem.  
$\phi(125=5^3) = (5-1)*5^{3-1} = 100$.  
So $2032^{monster} \equiv 32^{monster \% 100}$.
And $monster = 2031^{littlemonster}\equiv 31^{littlemonster}\pmod {100}$
$31$ and $100$ are relatively prime and $\phi(100)= 40$ so
$31^{littlemonster} \equiv 31^{littlemonster \% 40} \pmod {100}$.
$littlemonster = 2030^{smallmonster}$ but $5|2030$ and as $smallmonster > 2$ we know $8|2^{smallmonster}$ and $2^{smallmonster}|2030^{smallmonster}$.
So $littlemonster \equiv 0 \pmod {40}$.
$2031^{littlemonster} \equiv 31^0 \equiv 1 \pmod {100}$
So $2032^{monster} \equiv 32 \pmod {125}$
So $2032^{monster} \equiv 0 \pmod 8$ and $2032^{monster} \equiv 32 \pmod {125}$.
As $8|32$ we are done.  $2032^{monster} \equiv 32 \pmod {1000}$.
and the last three digits are $032$.