How to evaluate the following sum? $\sum_{i = 1}^n \left\lfloor \frac{3n-i}{2}\right\rfloor.$

756 Views Asked by At

What is the value of the following sum? $$\sum_{i = 1}^n \left\lfloor \dfrac{3n-i}{2}\right\rfloor.$$ Especially how to handle the sums with floors? This sum appeared while solving this problem.

My work: I tried ignoring floor and assuming that it will count an extra $\frac12$ for exactly $\left\lfloor \tfrac n2 \right\rfloor$ times, but the values do not match for the small test cases that I solve with hand.

3

There are 3 best solutions below

1
On BEST ANSWER

This answer is only for $n$ even. For $n$ odd, it can be done similarly.

Write $n=2k$ for some integer $k$. Then \begin{align} \sum_{i = 1}^n \left\lfloor \dfrac{3n-i}{2}\right\rfloor&=\sum_{i = 1}^{2k} \left\lfloor \dfrac{6k-i}{2}\right\rfloor\\ &=\sum_{i \textrm{ even}}^{2k} \left\lfloor \dfrac{6k-i}{2}\right\rfloor+\sum_{i \textrm{ odd}}^{2k} \left\lfloor \dfrac{6k-i}{2}\right\rfloor\\ &=\sum_{i=1}^{k} \left\lfloor \dfrac{6k-2i}{2}\right\rfloor+\sum_{i=1}^{k} \left\lfloor \dfrac{6k-(2i-1)}{2}\right\rfloor\\ &=\sum_{i=1}^{k} \left\lfloor 3k-i\right\rfloor+\sum_{i=1}^{k} \left\lfloor 3k-i+\frac12\right\rfloor\\ &=\sum_{i=1}^{k} ( 3k-i)+\sum_{i=1}^{k} (3k-i)\\ &=2\sum_{i=1}^{k} ( 3k-i). \end{align}

I am sure from this point you can continue by yourself, can't you?

3
On

We start with a special case of the Hermite Identity, which states that $\forall x \in \Bbb R, \left\lfloor x \right\rfloor + \left\lfloor x+ \frac {1}{2}\right\rfloor = \left\lfloor2x\right\rfloor.$ Substituting $x=\frac{3n-(i+1)}{2}$, we obtain $$\left\lfloor \frac{3n-i}{2}\right\rfloor+\left\lfloor \frac{3n-(i+1)}{2}\right\rfloor=\left\lfloor3n-(i+1)\right\rfloor=3n-(i+1).$$

Now check the cases when $n$ is odd or even.

0
On

\begin{align*} \sum_{k=1}^n\left\lfloor\dfrac{3n-k}{2}\right\rfloor&=\sum_{k=1}^n \left(n+\left\lfloor\dfrac{n-k}{2}\right\rfloor\right)\\ &=n^2+\sum_{k=0}^{n-1}\left\lfloor\dfrac{k}{2}\right\rfloor\\ &=n^2+\left\lfloor\dfrac{(n-1)^2}{4}\right\rfloor \end{align*}