Calculate $2^n \pmod{14^8}$ with large numbers quickly

275 Views Asked by At

Is there a way to calculate $2^n \pmod{14^8}$ faster than binary exponentiation? The $n$ values in question are very large, for example $2^{65536}$, and the calculations have to be done around $14^8$ times. The ultimate goal is to calculate numbers that use Knuth's up-arrow notation. Maybe the Chinese Remainder Theorem can be used here to reduce the problem space from $14^8$ to $7^8$ or further, as I am using arrays to memoize values.

1

There are 1 best solutions below

0
On BEST ANSWER

I've found the answer given here. In summary, divide $14^8$ by $2^8$, and use Euler's theorem to find the exponent $\mod \varphi(7^8)$.