Consider for inner for loop :
If the loop would have been:
for( j=1; j<n ; j= j+2)
Then the loop would have iterated n/2 times
So now in place of '2' we have 'i' : So my loop will iterate n/i times.
So this will vary with value of and we will get a series of : n + n/2 + n/3 + n/4........
=> n( 1 + 1/2 + 1/3.....)
=> nlogn