Sum over k of Floor of Root k

Theorem
Let $n \in \Z_{> 0}$ be a strictly positive integer.

Let $b \in \Z$ such that $b \ge 2$.

Then:
 * $\displaystyle \sum_{k \mathop = 1}^n \left \lfloor{\sqrt k}\right \rfloor = \left \lfloor{\sqrt n}\right \rfloor \left({n - \dfrac {\left({2 \left \lfloor{\sqrt n}\right \rfloor + 5}\right) \left({\left \lfloor{\sqrt n}\right \rfloor - 1}\right)} 6 }\right)$

Proof
From Sum of Sequence as Summation of Difference of Adjacent Terms:


 * $\displaystyle \sum_{k \mathop = 1}^n \left \lfloor{\sqrt k}\right \rfloor = n \left \lfloor{\sqrt n}\right \rfloor - \sum_{k \mathop = 1}^{n - 1} k \left({\left \lfloor{\sqrt {k + 1} }\right \rfloor - \left \lfloor{\sqrt k}\right \rfloor}\right)$

Let $S$ be defined as:
 * $\displaystyle S := \sum_{k \mathop = 1}^{n - 1} k \left({\left \lfloor{\sqrt {k + 1} }\right \rfloor - \left \lfloor{\sqrt k}\right \rfloor}\right)$

We have that:
 * $\sqrt {k + 1} - \sqrt k < 1$

and so:
 * $\left \lfloor{\sqrt {k + 1} }\right \rfloor - \left \lfloor{\sqrt k}\right \rfloor = 1$

$k + 1$ is a square number.

So: