sum=0;
for(i=1; i<n;i++)
for( j = 1; j < i * i; j++ )
if( j % i == 0 )
for( k = 0; k < j; k++ )
sum++;
I know that the outer most loop executes n time, the next loop n^2 times, but how do I factor the j%i with the loop? The correct answer is O(N^4), but I am not sure how that is reached.