If it's $2/3$ digits I could easily do that. But when I'm using Euler theorem, I still have to compute $3^{34567} \mod 100000$, which is still hard. Thank you in advance!
Asked
Active
Viewed 867 times
2
-
Solve $x\pmod {5^5}$ and $x\pmod {2^5}$ sparately. – Thomas Andrews Feb 18 '18 at 01:25
-
See https://math.stackexchange.com/questions/789050/last-3-digits-of-3999 – lab bhattacharjee Feb 18 '18 at 01:33
1 Answers
1
It happens that $3$ has order $8\bmod 2^5=32$, so $$3^{1234567}\equiv 3^{1234567\bmod 8}=3^7\mod 2^5.$$
As to the congruence class $\bmod 5^5=3125$, we have $\varphi(5^5)=4\cdot 5^4=2500$, so $$3^{1234567}\equiv 3^{1234567\bmod 2500}=3^{2067}\mod 5^5.$$ This requires $11$ squarings and $3$ multiplications mod. $3125$ by the fast exponentiation algorithm.
Once you have the powers mod $32$ and mod $3125$, you can readily deduce the power mod $100{,}000$ by the explicit Chinese remainder theorem.

Bernard
- 175,478