2

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.

3 Answers3

2

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?$

2

You can use Euler's Theorem with the Chinese Remainder Theorem. $100 = 4\cdot 25.$

Modulo $4$ you have

$$77777^{77777} \equiv 1^{77777} \equiv 1 \pmod{4}.$$

Modulo $25$ you have, since $\phi(25) = 20$

$$77777^{77777} \equiv 2^{77777} \equiv 2^{17} \equiv 1024 \cdot 128 \equiv -1\cdot 3 \equiv -3 \pmod{25}.$$

Now solve the system

$$x\equiv 1 \pmod{4}$$ $$x \equiv -3 \pmod {25}$$

to get $x=97 \pmod{100}.$

0

Since the multiplicative group $(\mathbb Z/100\mathbb Z)^*$ is isomorphic to the direct product $(\mathbb Z/2^2\mathbb Z)^*\text {x}\space (\mathbb Z/5^2\mathbb Z)^*$ and $77$ is odd and invertible in the ring $\mathbb Z/100\mathbb Z$, the order of the subgroup generates by $77$ could be only $1,2,4,5,10$ and $20$ (the possible factors of $20=\phi(5^2)=5^2-5$). One verify that this order is $20$ then $$77^{77777}=77^{3888\text{ x}20+17}=77^{17}\pmod{100}$$ It follows easily that $$77^{17}=97\pmod{100}$$

Piquito
  • 29,594