I have problem calculating the following summation: $$ S = \sum_{j=1}^{k^2-1} \lfloor \sqrt{j}\rfloor. $$
As far as I understand the mean of that summation it will be something like $$1+1+1+2+2+2+2+2+3+3+3+3+3+3+3+\cdots$$ and I suspect that the last summation number will be $(k-1)^2$, but I really can't find the pattern of the equal simpler summation.
Try replacing it by a sum of the form $\sum_1^k k \cdot c_k$, where $c_k$ is the number of times that $\lfloor \sqrt{j} \rfloor = k$.