What is the sum of the series? $\sum_{i=0}^{K+N-3}\left\lfloor \frac{i}{N-1} \right\rfloor$

61 Views Asked by At

What is the sum of the series given by $$\sum_{i=0}^{K+N-3}\left\lfloor \frac{i}{N-1} \right\rfloor$$ Where $N \in [2,100000)$ and $k \in [1,100000)$

Please help me find the first term and last term of the ap so I can find the sum of this series? if n =2 and k= 6, then answer is 15 if n= 3 and k=7 then answer is 12

1

There are 1 best solutions below

0
On

Work in progress:

Hint

You should first change variables so that $U = N - 1$ to simplify the problem. Then the problem becomes: $$\sum_{i = 0}^{K+U-2} \left\lfloor\frac{i}{U} \right\rfloor ;\ u \in [1, 10^5), k \in [1, 10^5)$$

Notice from the graph that the sum from $0$ to $U$ is $0$, from $0$ to $2U$ is U, from $0$ to $3U$ is $3U$, from $0$ to $4U$ is $6U$ and so on. Using the formula for triangular numbers, the sum from $0$ to $\lfloor{K+U-2}\rfloor$ will be $\frac{1}{2} \left(U \cdot \lfloor \frac{K+U-4}{U} \rfloor \right) \left(U \cdot \lfloor \frac{K+U-4}{U} \rfloor+1 \right)$, and then you can add the last few terms by hand.

Now change variables back to $N$.

Added after comment:

With $N=3, K=7$, we have $U=2$. So the summation becomes:

$$\sum_{i=0}^{7+2-2} \left\lfloor\frac{i}{2} \right\rfloor $$

Using the formula, we have $U \cdot \left \lfloor \frac{(K+U-4)}{U} \right \rfloor = 2 \cdot \left \lfloor\frac{7+2-4}{2} \right \rfloor = 4$, which rounds to the greatest integer that is on the next 'step' down. Therefore, the sum from $will be $\frac{4(4+1)}{2}$