Skip to main content
3 of 3
added 33 characters in body

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?

Edit : 'm' is a prime number.