Find last two digits of a number $A=(2016^{2015^{2014}}+2014^{2015^{2016}}+2017)^{2017}$ Find last two digits of a number $A=(2016^{2015^{2014}}+2014^{2015^{2016}}+2017)^{2017}$.
I have tried to write $A=100k+r$ and find r in $A$ but I stuck at it. Any solution will be aprreciated. Thank you.
 A: We work below modulo $100$. Then
$$
\begin{aligned}
A
&=\left(\ 2016^{2015^{2014}}+2014^{2015^{2016}}+2017\right)^{2017}
\\
&=\left(\ 16^{2015^{2014}}+14^{2015^{2016}}+17\right)^{2017}
\\
&=\left(\ 
 16^{2015^{2014}\text{ taken modulo }5}
+14^{2015^{2016}\text{ taken modulo }10}
+17\right)^{2017}
\\
&\qquad\text{ since $16^1=16^{1+5}$ and $14^2=14^{2+10}$, both modulo hundred}
\\
&\qquad\text{ and we have periodic repetitons after $16^1$ and $14^2$ with periods $5,10$}
\\
&=\left(\ 
 16^{5}
+14^{5}
+17\right)^{2017}
\\
&=\left(\ 
 76
+24
+17\right)^{2017}
=17^{2017}
\\
&=17^{2017\text{ taken modulo }40=\phi(100)}
\\
&= 17^{17}=77\ .
\end{aligned}
$$
All equalities hold in $\Bbb Z/100$.
A: Consider the equation mod 100, then we get $(16^{2015^{2014}}+14^{2015^{2016}}+17)^{2017}$. Now $16^6 = 16 mod(100)$, and power of 14 recycle after 10 times. so we have to consider the powers of 16 mod 5 and powers of 14 mod 10 and taking considerations of the first terms. 
by $(16^5+14^5+17)^{2017}(mod100)=(76+24+17)^{2017}=17^{2017}$. Now order of 17 is 20 in mod 100 and 2017 is 17 mod 100 so $17^{17}=77$ mod 100
