When you write your Python program, try switching between the my_exp and my_exp2 algorithms. I wouldn't be surprised if you actually notice the speed difference, at least outside of really tiny n. (Please report whether you can?)
Will do!
Interesting that it takes more work to calculate the inverse than to check it
This is extremely common, and is in fact a very important principle.
http://en.wikipedia.org/wiki/P_versus_NP_problem
Yup, I know about P vs. NP. Fascinating stuff.
