<s>[INST] Calculate the rest of the division of $(4^{103} + 2(5^{104}))^{102}$ by $13$ I already know some techniques to solve big exponents such as, Euler/Fermat Theorem,Euler/Carmichael,successive squaring.
But these problems seem to be more dificult as they involve operations insted of a single number.
How could I solve them ?


*

*$(4^{103} + 2(5^{104}))^{102}$ by $13$

*$53^{103}+103^{53}$ by $39$ 

 [/INST] $$ 
(4^{103}+2 \cdot 5^{104})^{102}\overset{13}{\equiv} 
(4^{3 \cdot 34+1}+2 \cdot 5^{2 \cdot 52})^{102}\overset{13}{\equiv} 
(4^{3 \cdot 34}4^1+2 \cdot 5^{2 \cdot 52})^{102}\overset{13}{\equiv} 
\\ 
\left((4^{3})^{34} \cdot 4^1+2 \cdot (5^{2})^{52}\right)^{102}\overset{13}{\equiv} 
\left(64^{34} \cdot 4^1+2 \cdot 25^{52}\right)^{102}\overset{13}{\equiv} 
\\ 
\left((-1)^{34}4^1+2(-1)^{52}\right)^{102}\overset{13}{\equiv} 
6^{102}\overset{13}{\equiv} 
6^{6}\overset{13}{\equiv} 
36^{3}\overset{13}{\equiv} 
10^{3}\overset{13}{\equiv} 
100.10\overset{13}{\equiv} 
9.10\overset{13}{\equiv} 
-1 
$$  


$$ 
53^{103}+103^{53}\overset{13}{\equiv} 
1^{103}+(-1)^{53}\overset{13}{\equiv} 
1-1\overset{13}{\equiv} 0;
$$
$$ 
53^{103}+103^{53}\overset{3}{\equiv} 
(-1)^{103}+1^{53}\overset{3}{\equiv} 
-1+1\overset{3}{\equiv} 0;
$$
which implies that $53^{103}+103^{53}\overset{39}{\equiv} 0$ .
</s>