How many iterations of the function $k →k−\left\lceil k^{1/2}\right\rceil$ are needed before k drops to 0?

79 Views Asked by At

Complexity question says that since $k \leq\frac{1}{4}n^2 \Rightarrow k−\left\lceil k^{1/2}\right\rceil \leq \frac{1}{4}(n-1)^2$, we have that it is $O(\sqrt{n})$. But I cannot see how this works?