Finding last two digits

How to find the last two digits of $$(3^{1997})$$ ...... I tried to do $$(3^{1997})$$ (mod 100) . I reached on that $$3^{20}$$ is congruent to 1 (mod 100) . But the calculation was getting very long after that . If anyone could correct me (or shorten) my method . Actually i have got the answer as 63 by this long process

• – lab bhattacharjee Nov 24 '16 at 17:48
• $$3^{2n}=(10-1)^n\equiv(-1)^n+\binom{2n}110\pmod{100}$$ – lab bhattacharjee Nov 24 '16 at 17:52

We have $3^{20}\equiv 1 \pmod {100}$ and $1997=29.99+17$, so we deduce that $3^{1997}=(3^{20})^{99}\cdot 3^{17}$, thus $3^{1997}\equiv 3^{17}\pmod {100}$. Now, since $3^{17}\equiv 63\pmod {100}$, then $3^{1997}\equiv 63 \pmod {100}$, and we get that the last two digits of $3^{1997}$ are $6$ and $3$.
• Note that $3^{17}=3^{20-3}$, and since $3^{20}\equiv 1\pmod {100}$, we only have to calculate $3^{-3}\pmod {100}$. Now, because $3\cdot 67\equiv 1\pmod{100}$, then $3^{-1}\equiv 67\pmod {100}$ and hence we get that $3^{17}\equiv 3^{-3}\equiv 67^3\equiv 63\pmod {100}$. – Xam Nov 25 '16 at 2:33
$100 = 2^2 \cdot 5^2$, so $\varphi(100) = 2 \cdot 5 \cdot 4 = 40$. That means if $a$ is coprime to $100$, $a^{40} \equiv 1 \mod 100$. Since $1997 = 40 \cdot 50 - 3$, $$3^{1997} \equiv 3^{-3} \mod 100$$ Now $3^{-1} \equiv 67 \mod 100$ (i.e. $3 \cdot 67 = 201 \equiv 1 \mod 100$), and $67^3 = 300763 \equiv 63 \mod 100$, so we conclude $$3^{1997} \equiv 63 \mod 100$$
From Euler's Theorem, and the fact that $\phi(100)=40$, we have that $3^{40} \equiv 1 (\bmod{100}).$ So $3^{1997} \equiv 3^{2000}3^{-3} \equiv (3^{40})3^{-3} \equiv 3^{-3} (\bmod{100}).$
It's not to hard to get an inverse for $3$ modulo $100$, since $1\equiv 201 \equiv 3\cdot 67 (\bmod{100}).$ So $3^{1997} \equiv 67^3 \equiv 63 (\bmod{100}).$