Find two last digit of $77777^{77777}$

elementary-number-theory

Find two last digit of $77777^{77777}$

observation:

We want to find $77777^{77777} \mod 100$. To simplify our exercise, we can consider only two last digits. So I am looking for length of cycle…

$$ 77^{0} \equiv 1\mod 100 \\
77^{1} \equiv 77\mod 100 \\
77^{2} \equiv 29\mod 100 \\
77^{3} \equiv 33\mod 100 \\
77^{4} \equiv 41\mod 100 \\
77^{5} \equiv 57\mod 100 \\
77^{6} \equiv 89\mod 100 \\
77^{7} \equiv 53\mod 100 \\
77^{8} \equiv 81\mod 100 \\
77^{9} \equiv 37\mod 100 \\
77^{10} \equiv 49\mod 100 \\
77^{11} \equiv 73\mod 100 \\
77^{12} \equiv 21\mod 100 \\
77^{13} \equiv 17\mod 100 \\
77^{14} \equiv 9\mod 100 \\
77^{15} \equiv 93\mod 100 \\
77^{16} \equiv 61\mod 100 \\
77^{17} \equiv 97\mod 100 \\
77^{18} \equiv 69\mod 100 \\
77^{19} \equiv 13\mod 100 \\
77^{20} \equiv 1\mod 100 \\
$$

Ok, so cycle has length $20$. $77777 \mod 20 = 17$ so my result is
$$ 97 $$
and there is a question – is there any faster method to find length of cycle? I mean that calculating each next modulo costs a lot of time and I am looking for some faster method.

Best Answer

Use http://mathworld.wolfram.com/CarmichaelFunction.html

to reduce the exponent $77777\equiv17\pmod{\lambda(100)}$

Again $77^{17}=77(77^2)^8\equiv77(30-1)^8\equiv77(1-30)^8\pmod{100}$

$\equiv77(1-30\cdot8)$

$\equiv77(100-39)\equiv?$