Consider the following algorithm, where $n$ is a parameter.
sum = 0 ; for ( i = 0 ; i < n ; i++ ) for ( j = 1 ; j < n^3 ; j = 3*j ) sum++ ;
What is the time complexity (in $\Theta$-notation) in terms of n?
So far, this is what I've done: The running time is $\Theta (N^4)$ Because the for loop’s condition is depend on $n$ and is incremented by $1$, and then inside running time is $O(1)$. I feel i'm wrong here. Any help would be appreciated.