centenes of $7^{999999}$ 
What is the value of the hundreds digit of the number $7^{999999}$?

Equivalent to finding the value of $a$ for the congruence $$7^{999999}\equiv a\pmod{1000}$$
 A: Let $\varphi$ denote the Euler Phi function, then
$$
\varphi(1000) = \varphi(2^35^3) = (8-4)(125-25) = 400
$$
Hence, by Euler's theorem,
$$
7^{400} \equiv 1 \pmod{1000}
$$
Hence,
$$
7^{999999} \equiv 7^{399} \equiv 7^{-1} \pmod{1000}
$$
Now,
$$
143\cdot 7 - 1000 = 1
$$
And hence $7^{-1} \equiv 143$. Hence,

The hundreds digit of $7^{999999}$ is 1.

A: Use Euler's theorem: $7^{\phi (1000)} ≡ 1 \mod 1000 $.
By Euler's product formula: $\phi(1000) = 1000\cdot(1-\frac{1}{2})\cdot(1-\frac{1}{5})=400$
So $7^{400}≡1 \mod 1000 $.
$999999=400\cdot 2500-1$. So it suffices to find $7^{399}\mod 1000$.
A: Using Carmichael function, $$\lambda(1000)=100\implies 7^{100}\equiv1\pmod{1000}$$
Alternatively,
we have $7^2=49=50-1,7^4=(50-1)^2=50^2-2\cdot50\cdot1+1^2=1+2400$
$7^{20}=(7^4)^5=(1+2400)^5=1+\binom512400+\binom52(2400)^2+\cdots\equiv1\pmod{1000}$
Now , $999999\equiv-1\pmod{100}\equiv-1\pmod{20}$
So in either case,  $7^{999999}\equiv7^{-1}\pmod{1000}$
$$\text{Now, }\frac{1000}7=142+\frac67=142+\frac1{\frac76}=142+\frac1{1+\frac16}$$
So, the previous convergent of $\displaystyle\frac{1000}7$ is $\displaystyle142+\frac1{1+\frac11}=\frac{143}1$
Using convergent property (Theorem $3$ here) of continued fraction, $1000\cdot1-7\cdot143=-1$
$\displaystyle\implies 7^{-1}\equiv143\pmod{1000}$
