0

I thought of using $\text{mod } 10000$ on this but $10000$ and $5$ are not co-prime nor $10000$ is prime so I was not able to apply Fermat or Euler's Theorem . Any Hint would be appreciated.

Alann Rosas
  • 5,421
  • 1
  • 9
  • 28

1 Answers1

5

You want $\bmod 100000$ to get the fifth digit from the end of the number.

$5^5\equiv1\bmod4$, so by Euler's theorem $5^{5^5}\equiv5\bmod8$,

so by Euler's theorem $5^{5^{5^{5}}}\equiv5^5\equiv5\bmod16$,

so by Euler's theorem $5^{5^{5^{5^5}}}\equiv5^5=3125 \bmod32$.

Also, $5^{5^{5^{5^5}}}\equiv0\equiv3125\bmod5^5 $.

Therefore, since $5^{5^{5^{5^5}}}\equiv3125\bmod 5^5$ and $\bmod2^5$,

by the Chinese remainder theorem $5^{5^{5^{5^5}}}\equiv3125\bmod10^5$,

so the last five digits of $5^{5^{5^{5^5}}}$ are $\color{blue}03125$.

J. W. Tanner
  • 60,406