# using fermat's little theorum and problem solving

#### apple2010

Give two different methods for finding 2^999(mod 5), one using Fermat's little theorem and the other using basic problem solving methods.

#### roninpro

I'll give you a hint for a basic method. Write $$\displaystyle 2^{999}\equiv 2\cdot 2^{998}\equiv 2\cdot 4^{499}\pmod{5}$$. Can you compute this directly?

#### firebio

Give two different methods for finding 2^999(mod 5), one using Fermat's little theorem and the other using basic problem solving methods.
Using Fermats little theorem $$\displaystyle 2^4 \equiv 1 \pmod{5}$$
Then $$\displaystyle (2^4)^{249} \equiv 1 \pmod{5}$$
Finally $$\displaystyle (2^4)^{249}*2^3 \equiv 1*2^3 \pmod{5}$$
therefore $$\displaystyle 2^3 \equiv 3 \pmod{5}$$
So $$\displaystyle 2^{999} \equiv 3 \pmod{5}$$