No, it is not O(4).
A better way to see this is to count how many times the loop executes(in fact, that is what the code is doing).
sum(sum(sum(1, k=0..j), j=0..i*i), i=0..n)
= sum(sum(j,j=0..i*i),i=0..n) = sum(i*i*(i*i+1)/2,i=0..n)
which is on the order of sum(i^4, i=0..n) which is on the order of n^5.
Essentially because the middle loop is i*i and is being executed for each of the inner most loop it needs to be counted an extra time.
In C++
http://codepad.org/nKJ9IUnt
1 0
2 0
3 6
4 42
5 162
6 462
7 1092
8 2268
9 4284
10 7524
11 12474
12 19734
13 30030
14 44226
15 63336
16 88536
17 121176
18 162792
19 215118
You can use this table and compute the finite differences(taking derivatives) until the result is a constant or 0. You'll find that it takes 5 derivatives to have a constant list. This means that it the list is on the order of n^5.
e.g., If we had a list where each difference between two elements were a constant then the list could be represented by a linear function. If the difference of the difference was constant then it would be a quadradic, etc. (it doesn't matter about the lower order terms because they get translated by the derivative/difference)