Finding the last two digits of $17^{198}$ Question 1: What are the last two digits of $17^{198}$?


My Attempt: The pdf hinted to reduce it via mod $100$. So my work is as follows:

Since $17^2\equiv289\equiv-11\mod100$, we have$$17^{198}\equiv (-11)^{99}\equiv-11^{99}\mod100$$
However, I'm not sure how to compute $-11^{99}$ without too much of a hassle.


  Questions:



How do you complete this problem?
Why use mod $100$? Why not mod $50$ or some other number?
An alternative approach, exploiting the Chinese remainder theorem and the fact that $2$ is a generator in $\mathbb{Z}/(25\mathbb{Z})^*$:

$$ 17^{198}\equiv (-8)^{198} \equiv 2^{3\cdot 198} \equiv 2^{14} \equiv 16\cdot 1024\equiv -16\equiv 9\pmod{25} $$
$$ 17^{198}\equiv 1\pmod{4} $$
together imply $17^{198}\equiv \color{red}{9}\pmod{100}$.
Let $G=(\mathbb{Z}/100\mathbb{Z})^{*}$. Since $|G|$=40 and $17\in G$, we have
$$ 17^{198} = 17^{40\cdot 5}\cdot 17^{-2}=1\cdot 17^{-2} \ mod\ 100$$
To find $17^{-2}\ mod\ 100$ we note first that $17\cdot 3 = 1 \ mod \ 10$. Then, we only have to solve
$$ 17\cdot (10x+3) = 1 \ mod\ 100$$
for $x\in[0,9]\cap\mathbb{Z}$, in order to find the inverse. Doing some computations, we find
$$ 70x=50 \ mod\ 100 $$
$x=5$ solves the equation and one can verify directly that $17\cdot 53=1 \ mod\ 100$. We deduce $17^{198}=53^2 = 9\ mod\ 100$