Calculate the sum $\sum_{n=1}^{1,000,000} \lfloor \sqrt{n} \rfloor$.

You may use the formula $\sum_{i=1}^{k} i^2=\frac{k(k +1)(2k +1)}{6}$ without a proof.

Let's think step by step and output the final answer within \boxed{}.
user