0

Find the remainder after division when $4^{2018}$ is divided by $29$.

My approach:

we have $$4^{2018}=16^{1009}=-\left(1-17\right)^{1009}=-\left(\binom{1009}{0}-\binom{1009}{1}17+\binom{1009}{2}17^2+\cdots\binom{1009}{1009} 17^{1009}\right)$$

Now $$17^2 \equiv -1 \pmod{29}.$$

Any hint how to proceed now?

Jyrki Lahtonen
  • 133,153
Ekaveera Gouribhatla
  • 13,026
  • 3
  • 34
  • 70

2 Answers2

5

Using Fermat's little theorem, we have $$4^{28k +m} \equiv 4^{m} \pmod{29}.$$ As such, $$4^{2018} \equiv 4^2=16 \pmod{29}.$$

Math Lover
  • 15,153
3

Since $2\,018\equiv2\pmod{28}$, Fermat's little theorem tells you that$$4^{2\,018}\equiv4^2\pmod{29}.$$Therefore, the answer is $16$.