0

Here is the answer I've been reading Evaluate $\sum_{k=1}^n\lfloor \sqrt{k} \rfloor$ (the first one) but I'm having trouble understanding it (specifically this part: The remaining $n+1-( \lfloor \sqrt{n} \rfloor)^2$ summands are $\lfloor \sqrt{n} \rfloor$ each.

Why is there that many of them?It is probably pretty obvious since there was nobody in the comments asking for the clarification but I'm really bad at these sort of things. Someone care to explain?

Bill Dubuque
  • 272,048

1 Answers1

2

The summands $\lfloor \sqrt k\rfloor$ go like this: $$1,1,1,2,2,2,2,2,3,3,3,3,3,3,3,4,4,4,\ldots $$ Note that a $1$ occurs precisely for those $k$ with $1\le\sqrt k<2$, i.e., with $1^2\le k<2^2$, so $2^2-1^1=3$ times. More generally, $r$ occurs percisely for those $k$ with $r\le\sqrt k<r+1$, i.e., with $r^2\le k<(r+1)^2$, so $(r+1)^2-r^1=2r+1$ times. At least this is true when all $k$ in that range are among our summands, i.e., when $(r+1)^2\le n+1$. The last part may but be incomplete because we have to stop at $k=n$ instead of going up to $k=(r+1)^2-1$. In other words, the last part is determined by the condition $r^2\le n<(r+1)^2$, i.e., $r=\lfloor\sqrt n\rfloor$. This part still contains repeated values of $r$, but instead of $(r+1)^2-r^2=2r+1$ times only $(n+1)-r^2$ times.