Essentially, instead of us halving the time of computation, every time we have an even number, we instead halve the expmod call but then, make that call twice, in other words, instead of (specifically for even number): T(n) = O(1) + T(n/2) we get: T(n) = O(1) + 2*T(n/2), which is going to give us roughly: O(n) We get a recursion tree, growing exponentially with at every recursive call, of which there are O(log n), so exp(log(n)) = n.