Analyzing the time complexity of nested loops
Translating for-loops into sums is the best way to approach this as the resulting calculations are elementary. We get:

$\qquad\displaystyle\begin{align*}
\#\mathrm{Task} \quad&amp;= &amp;&amp;\sum_{i=1}^n \sum_{j=1}^{n^2} \sum_{k=1}^j 1 \\
                     &amp;= &amp;&amp; \sum_{i=1}^n \sum_{j=1}^{n^2} j \\
                     &amp;= &amp;&amp; \sum_{i=1}^n \frac{n^2(n^2 + 1)}{2} \\
                     &amp;= &amp;&amp; \frac{n^3(n^2 + 1)}{2}.
\end{align*}$

We use the closed form of the triangular numbers (which you find on any formulary if you have not memorized it). Finally, obtain a $\Theta$-class using standard tools.