sum = 0
for (i = 0; i < n; i++)
for (j = 0; j < i * i; j++)
for(k = 0; k < n; k++)
++sum
Here is my work
The outer most loop:
$$ \sum_{i}^{n} $$ The first inner loop: $$ \sum_{j}^{i^2} $$ The second inner loop: $$ \sum_{k}^{n} $$ So I end up with: $$ \sum_{i}^{n}\sum_{j}^{i^2}\sum_{k}^{n} \\ \sum_{i}^{n}\sum_{j}^{i^2}n\\\sum_{i}^{n}\frac{j^2(j^2+1)}{2}\\ $$
From that I get that the complexity is $O(n^8)$. Am I correct?
I cannot see the code, please paste the text into the question instead of the picture. The last step looks incorrect. Simplify $$ \sum_{j=1}^n j^2(j^2+1) = \sum_{j=1}^n j^4 + \sum_{j=1}^n j^2, $$ and the first term is $\Theta(n^5)$ while the second is $\Theta(n^3)$, so the sum is $$\Theta(n^5)+\Theta(n^3)=\Theta(n^5).$$
UPDATE
Now you have $$ \sum_{i=1}^n \sum_{j=1}^{i^2} \sum_{k=1}^n 1 = \sum_{i=1}^n \sum_{j=1}^{i^2} n = n \sum_{i=1}^n \sum_{j=1}^{i^2} 1 = n \sum_{i=1}^n i^2 = n \frac{n(n+1)(2n+1)}{6} = \Theta\left(n^4\right) $$