I need to find $63^{63^{63}} \bmod 100$.
This is what I've got so far:
Since $\gcd(63,100)=1$ we can use Euler's theorem. We have $\phi (100)=40$ so $63^{40} \equiv 1 \mod 100$
Again $\gcd(16,100)=1$ and $\phi (40)=16$, that is $63^{16} \equiv 1 \mod 40$
Using this I got that $63^{63} \equiv 7 \mod 40 $ which led me to $63^{63^{63}} \equiv 63^7 \mod 100$
I'm stuck here and don't know what to do next, what could I do now?

- 272,048

- 159
- 10
-
$\gcd(16,100)=4$, but the end result is ok. Just calculate $63^7$ incrementally (i.e. $63^7=63\times 63^2\times 63^4$ and $63^2\equiv 69\pmod{100}$ then $69^2$ and so on...). – zwim Mar 19 '21 at 18:19
-
$63^7 =(60 + 3)^7 = \sum {7\choose k}60^{7-k}3^k \equiv 7\cdot 60\cdot 3^6 +3^7 \equiv 20\cdot 3^6 + 3^7 \pmod{100}$.... And $3^6 \equiv 9^3 \equiv (10-1)^3 \equiv 30 -1$ – fleablood Mar 19 '21 at 19:53
5 Answers
You have done the hard work which can be reached by Carmichael Function as well
Now, $63^2=(60+3)(60+3)\equiv2\cdot60\cdot3+3^2\equiv70-1$
$\displaystyle 63^7=63(70-1)^3\equiv63(-1+\binom31\cdot70^1)\pmod{100}\equiv(60+3)\cdot9\equiv40+27$

- 274,582
$(63)^7 = (60+3)^7 = (60^7 + {7\choose 1} 60^6\cdot 3 + \cdots + {7\choose 6} 60\cdot 3^6 + 3^7 $
All the terms to the left of the last 2 are equivalent to 0 modulo 100, and can be dropped.
Leaving $7\cdot 60\cdot 3^6 + 3^7\pmod {100}$
We only need to worry about the one figure for the first term since we know it will end in 0.
$3^4 = 81, 3^6\equiv 9 \pmod {10}$
$6\cdot 7 \cdot 9 \cdot 10 + 81\cdot 27\equiv 80 + 87 \equiv 67 \pmod {100}$

- 57,877
You might use Chinese Remainder Theorem. $100 = 4 \cdot 25$, and
$$63^7 \equiv (-1)^7 \equiv 3 \pmod{4}.$$
Then $$63^7 \equiv 9^7 7^7 \equiv 729\cdot 729 \cdot 9 \cdot 49^3\cdot 7 \equiv 4\cdot 4 \cdot 9 \cdot (-1)^3 \cdot 7 $$
$$\equiv 144(-7) \equiv (-6)(-7) \equiv 42 \pmod{25}.$$
So you just have to add or subtract various multiples of $25$ to $42$ until you get a number that's $3 \pmod{4}.$ And $42+25 = 67$ works.
Use the fast exponentiation algorithm:
\begin{array}{rrrr} n& x^{2^k} && P\bmod 100 \\\hline 7 & 63 && 63 \\ 3 & 69 &&69\cdot 63\equiv 47 \\ 1 & 61 && 61\cdot 47\equiv \color{red}{67} \\\hline \end{array}

- 175,478
$63^7 = (60 +3)^7= ..... + {7\choose 2}60^2\cdot 3^5 + 7\cdot 60\cdot 3^6 + 3^7 \equiv 20\cdot 3^6 +3^7\pmod{100}$.
And as $2\cdot 3^6 \equiv 2\cdot 3^2 \equiv 8 \pmod {10}$ and as $3^7 = 9^3\cdot 3 = (10-1)^3 \cdot 3 = 3(100^3 - 3\cdot 100 + 3\cdot 10 - 1)\equiv 90-3 \equiv 87 \pmod {100}$
So have $63^7\equiv 20\cdot 3^6 + 3^7 \equiv 80 + 87 \equiv 67 \pmod{100}$.
.....
Also nothing wrong with successive squaring. $7$ is a small number.
$63^2 = 3969 \equiv 69$.
So $63^3 \equiv 69\cdot 63 = 4347 \equiv 40 + 80 + 27\equiv 47\pmod {100}$.
So $63^6 \equiv 47^2 \equiv 2209\equiv 9\pmod{100}$ and so
$63^7 \equiv 9\cdot 63 \equiv 567 \equiv 67 \pmod {100}$

- 124,253