Running time of algorithm (effect of j*j in for loops) - Theta Runtime
1
For the first case, you had the right idea, but just had some algebra mistakes.
for i=1..n
    j=1
    while j*j &lt;= i:
        j = j + 1

Let $T(n)$ be the time complexity.
$$T(n) = \sum_{i=1}^n\sum_{j=1}^\sqrt{i}1\leq  \sum_{i=1}^n\sqrt{n}=\leq n^{3/2}$$
$$= O(n^{3/2})$$
2
I'm assuming you meant the pseudocode below since it is more analogous to your first case (I believe the pseudocode you posted has the same complexity). You are correct though, it is $O(n\log n)$ for the reason you described.
for i=1..n
    j=2
    while j &lt;= i
        j = j * j