finding remainder $13^{99}-19^{93}$ is divided by 162. how to find remainder when 
$13^{99}-19^{93}$ is divided by 162.
I tried writing 19 as 18+ 1 and 13 as 18-5 but 
still not able to solve.
 A: $162=3^4\cdot2$
$$13^{99}=(1+12)^{99}\equiv1+\binom{99}112\pmod{162}$$
$$19^{93}=(1+18)^{93}\equiv1+\binom{93}118\pmod{162}$$
A: Use the binomial theorem, along with the powers. But we have to be clever : to ensure in a binomial expansion that many terms are multiples of $162$ , we must ensure that the summands(i.e. the $x,y$ in $(x+y)^n$) either are divisors by $162$ or share factors in common, so that raising them to high powers end up capturing the required power of a prime factor they share with $162$, compensating for that prime factor. Note that $162 = 2 \times 3^4$ : it is enough to show that it is a multiple of $2$ and of $3^4 = 81$ then.
However, note that $13^{99}-19^{93}$ is even, so we only need to show that it is a multiple of $81$ to conclude. In this regard, all we need to do is note that $13=9+4$ and $19=27-8$ provide good binomial break ups since $9$ and $27$ are powers of $3$ whose squares have $81$ as a divisor.

So write $19^{93} = (27-8)^{93}$. By the binomial expansion :
$$
19^{93} = \sum_{i=0}^{93} \binom{93}{i}27^i8^{93-i} = \color{green}{\sum_{i=2}^{93} \binom{93}{i} 27^i8^{93-i}} + \mbox{ the rest}
$$
where the green part is a multiple of $81$. The rest consists of $8^{93} + 27 \times 8^{92} \times 93$, the latter of which is a multiple of $81$. So we only have to compute $8^{93} \mod 81$. Use Euler's theorem to conclude that $8^{72} \equiv 1 \mod 81$, since $72 = \phi(81)$. 
Now, you have to check $8^{21} \mod 81$, this you can do.
Your task : do the same for $13^{99}$ using the suggested expansion, and complete the question.
A: $\begin{align}{\bf Hint}\ \, &\bmod 3\!:\ \ \ \ 13^{\large 4}\ \equiv\ (-2)^{\large 10}\ \ {\rm by}\ \ \ 13\equiv 1\equiv -2\\
\overset{\rm\large  cube}\Longrightarrow\ &\bmod 9\!:\ \ \ \ 13^{\large 12}\equiv (-2)^{\large 30} \\
\overset{\large -2\,\times}\Longrightarrow\ & \bmod 9\!:\ \ \ \ 13^{\large 11}\equiv (-2)^{\large 31}\ \ {\rm by}\,\ {-}2 \times {\rm prior,\,\  {-2}(13)\equiv 1} \\
\overset{\rm\large  cube}\Longrightarrow\ &\bmod 27\!:\,\ 13^{\large 33}\equiv (-8)^{\large 31}\equiv 19^{\large 31}\\[.3em]
\overset{\rm\large  cube}\Longrightarrow\ &\bbox[6px,border:1px solid #c00]{\!\!\bmod 81\!:\ 13^{\large 99}\equiv\ 19^{\large 93}}
\end{align}$
A: 13^99=(18-5)^99 expanding binomially every term will have 18^2 except last term hence all terms %162 will result to sum of last  term %162 which gives -5^99%162 
now 5^99=125^33=(126-1)^33 again expanding this will have 18^2 in every terms except last two which is (33*126-1)%162 affectively we will be left with -107 eqivalent to 55 as remainder 
 13^99%162=55
similarly second part is relatively easier to handle 19^93=(18+1)^93 expanding again will have 18^2 for every term except last two terms resulting in 55 as remainder
19^93%162=55
hence answer has to be 0
so 13^99-19^93=0 MOD 162  
