Im confused with this :s
Find the remainder in the range 0 to 999 when 7^(8^9) is divided by 1000
We're dealing with a huge power, and it confused me as to how I am supposed to work it out.
I could start with doing
7 = 7 mod 1000
7^2 = 49 mod 1000
7^3 = 343 mod 1000
7^4 = 401 mod 1000
and maybe work it out with multiples of them? But then again the number (8^9) is huge so it might not be practical.
I was thinking of using Fermats Little Theorem, but I am unsure as to where I should begin.
Any help would be appreciated!