Understanding Fermats Little Theorem

137 Views Asked by At

Say I was told to find:

$4^{1000} (mod 7)$

Since The modulo is prime, I can use fermats little theorem, now I'm just wondering if my steps are correct:

We have that:

$4^6 = 1(mod 7)$ //congruent

$1000/6 = $~166 //approx 166

$4^{1000} = (4^6)^{(166)}(4^4) $ //congruent

$= 1(4^4)(mod 7) = 4$ //congruent

Final answer = 4

I know the answer is correct, but is this the correct way of applying fermats theorem?

Any help would be much appreciated