n mod 4 asymptotic analysis best case and worst case
Best case and worst case are about the complexity for a fixed input length. As an example, suppose we are sorting an array of length $n$. There are many possible arrays of length $n$. On some of them the algorithm will be faster, on some it will be slower.

In your case, in contrast, the running time doesn't depend on the input, but only on its length. Therefore the best case and the worst case are both
$$
\begin{cases}
\Theta(n^2) &amp; \text{if } n \equiv 0 \pmod{4}, \\
\Theta(n^3) &amp; \text{if } n \equiv 1 \pmod{4}, \\
\Theta(n^4) &amp; \text{if } n \equiv 2 \pmod{4}, \\
\Theta(n^5) &amp; \text{if } n \equiv 3 \pmod{4}.
\end{cases}
$$