Find the remainder when $787^{777}$ is divided by $100$? Find the remainder when $787^{777}$ is divided by $100$?


MyApproach

$787^{20\times38+17}$=$787^{17}$=I will get the last digit of remainder as 7 but how to calculate tens digit in this question fast using this approach only.


  Similarly,Find the remainder when $948^{728}$ is divided by $100$.


On solving I get $948^8$=I will get the last digit of remainder as 7 but how to calculate tens digit in this question fast using this approach only.

Again here how to calculate the other digits fast.
Hint

$787^3 \equiv 03\pmod {100}$ and $3^{20} \equiv 01 \pmod {100}$

Now the problem becomes much simpler. The last two digits of $787^{780}$ are $01$. You can now easily work backwards.

Other Problem

You can tackle it similarly by observing 

$948^2 \equiv 04\pmod {100}$ and $4^{16} \equiv 04 \pmod {100}$

(You are not going to be lucky because with an even number, you will never get a $01$)

Edit - Alternately for first problem

You can use Fermat's little theorem, knowing $\phi(100) = 40$.

So any number, relatively prime with $100$, raised to $40$ will give $01$ and hence the last two digits of $787^{780}$ are $01$
We have $\pmod{100}$

$$787^{777}\equiv 87^{777}$$

And we have the following factorisations

$$87=3\times 29$$
$$777=3\times 7\times 37$$

$$87^3=658503\equiv 3\pmod{100}$$

And so

$$787^{777}\equiv 3^{7\times 37}\pmod{100}$$

Now we have $3^7=2187\equiv 87$ and so

$$787^{777}\equiv (3\times 29)^{37}\pmod{100}$$

So we're now left with $3^{37}$ and $29^{37}$ $\pmod{100}$.

A direct computation shows that $3^{15}=14348907\equiv 7\pmod{100}$ and $3^7=2187\equiv 87$ so

$$3^{37}\equiv 7\times 7\times 87=4263\equiv 63\pmod{100}$$

Another direct (and painful) computation shows that $29^7=17249876309\equiv 9$ and $29^{10}=420707233300201\equiv 1$ and so

$$29^{37}\equiv 9\pmod{100}$$

And now putting the two results together

$$787^{777}\equiv 9\times 63=567\equiv 67\pmod{100}$$