prime, mod, power(n) with O(N) = O(logN)