So this is my question:
Compute $7^{818} \pmod {1637}$ using no more than 14 multiplications mod 1637. (You should of course verify that 1637 is prime if you plan to use Fermat's Theorem.)
I would know how to do this problem if the power that 7 is raised to is higher than 1637. So if I had this:
$$ 2^{200}\pmod{101}$$
I could just do: $2^{100}\equiv 1\pmod{101}$ and go from there to solve. But if I have 1637 then I have to do:
$$7^{1636}\equiv 1\pmod{1637}$$
Then I would have:
$$7^{1636}7^{-818}...$$
But I know this is totally wrong. How do I go about this problem?
