How to evaluate the finite sequence (involving the floor function)?

150 Views Asked by At

How to sum this:$$ \lfloor\sqrt{1}\rfloor + \lfloor\sqrt{2}\rfloor + \lfloor\sqrt{3}\rfloor +\lfloor\sqrt{4}\rfloor + \ldots + \lfloor\sqrt{50}\rfloor = ?$$

3

There are 3 best solutions below

0
On BEST ANSWER

Perhaps the following is workable: put together the summands until the following square minus one

$$\lfloor\sqrt1\rfloor+\ldots+\lfloor\sqrt3\rfloor+\lfloor\sqrt4\rfloor+\ldots+\lfloor\sqrt8\rfloor+\ldots+\lfloor\sqrt{36}+\ldots\lfloor\sqrt{48}\rfloor+\lfloor\sqrt{49}\rfloor+\lfloor\sqrt{50}\rfloor=$$

$$=1+1+1+2+2+2+2+2+3+3+3+3+3+3+3+\ldots=$$

$$=1\cdot3+2\cdot5+3\cdot7+4\cdot9+5\cdot11+6\cdot13+7+7=...$$

0
On

Will answer the more general question of computing:

$$S(n)=\sum_{k=1}^n\lfloor\sqrt k \rfloor$$

  • Note that $1\le k\le n \implies 1\le\sqrt k \le \sqrt n \implies 1\le \lfloor \sqrt k\rfloor \le \lfloor \sqrt n\rfloor$.
  • Furthermore, note that $\lfloor\sqrt k \rfloor=m$ precisely when $m^2\le k \le (m+1)^2-1$.

So, we partition our sum accordingly:

$$S(n)=\sum_{k=1}^n\lfloor\sqrt k \rfloor=\sum_1^{4-1}1+\sum_4^{9-1}2+\sum_9^{16-1}3+\cdots +\sum_{\lfloor \sqrt n \rfloor^2}^{n}\lfloor \sqrt n \rfloor$$

$$=3\cdot1+5\cdot2+7\cdot3+\cdots+(n+1-\lfloor \sqrt n \rfloor^2)\lfloor \sqrt n \rfloor$$

$$=\sum_{m=1}^{\lfloor \sqrt n \rfloor-1}(2m+1)(m)+(n+1-\lfloor \sqrt n \rfloor^2)\lfloor \sqrt n \rfloor$$

With some extra work and care, we can evaluate the sum over $m$, giving:

$$S(n)=\frac{(\lfloor \sqrt n \rfloor)(\lfloor \sqrt n \rfloor-1)(4\lfloor \sqrt n \rfloor-5)}{6}+(n+1-\lfloor \sqrt n \rfloor^2)\lfloor \sqrt n \rfloor$$

I imagine that this can be expanded further and terms can be collected, but it's still going to end up a little messy with all of those floor signs.

0
On

$[\sqrt{n^2}] = n$

$[\sqrt{i}] = n$ if $n^2 < i < (n+1)^2 = n^2 + 2n + 1$

$[\sqrt{(n+1)^2 }] = n+1$

So $[\sqrt{n^2}] + [\sqrt{n^2}+1] + ... + [\sqrt{n^2} + 2n] = n + n + ... + n = n(2n + 1)$.

So $[\sqrt 1]+ [\sqrt 2] + [\sqrt 3] = 1 + 1 + 1 = 3$

So $[\sqrt 4] + [\sqrt 5] +[\sqrt 6] [\sqrt 7] +[\sqrt 8] = 2 + 2 + 2+2+2 = 2*5 = 10$

$[\sqrt 9] + .... + [\sqrt 15] = 3+3+...+3 = 3*7=21$

etc.