I know that the sum of digits formula is:
$\frac{k(k+1)}{2}$
I am calculating the computation complexity of an algorithm whose while loop is increasing at this factor, hence:
$\frac{k(k+1)}{2}>n$
At the time when the function increases over $n$, the while loop will exit.
Expanding the formula and solving for $k$:
$\frac{k^2+k}{2} > n$
This next line I do not understand, can someone explain how this line is achieved?
$k = O\left(\sqrt{n}\right)$
Regards