What's the runtime of 75^4096 mod 236?
For the specific case of m = 236 and n = 4096, it requires 12 multiplication and 12 division operations. For n = 4095, I think it actually requires 22 multiplications and 22 divisions. Also, if m is a compile time constant, the divisions can be implemented as multiplications instead, which gives a constant factor speedup.
https://en.wikipedia.org/wiki/Modular_exponentiation#Right-t...
I think you need an 'n' in there before it is meaningful to ask about the runtime.