Skip to main content
1 of 3

Calculating (n ^ fibonacci(k)) MOD m for a large value of k

The value of k can be very large indeed(Up to 10^12). Is there an efficient way to calculate the output?