answer:

For a given value of i, the inner loop runs for i steps, so the time is ic where c is the time for P(i, j, k).

For a given value of k, the middle loop runs with values of i = k, k/2, k/4, ...., 1, thus taking a number of steps

kc +kc/2 +kc/4 + .... + c

which is bounded by (2k-1)c.

The outer loop runs the middle loop with values of k = 1, 2, 4, ...., 2^floor(log N) (approximately N), for a total time of

(2*1-1 + 2*2-1 + 2*4-1 + .... + 2*N-1)c = 2*(1+2+4+....+N)c - clog N

which is bounded by 4Nc, so overall we have

O(N)