Sum of consecutive numbers with a rounded multiplier I know full well that the sum of the integers from $1$ to $n$ is $\frac{n * \left (n+1\right )}{2}$ but I need a formula that works for the rounded multiples of $\frac{9}{7}$ the integers from $1$ to $n$.
e.g.




$n$
$\lfloor\frac{9}{7}n\rceil$
cumulative sum




1
1
1


2
3
4


3
4
8


4
5
13


5
6
19


6
8
27




any ideas?  i don't even know what to search for so i don't know how to tag this question.
 A: You’re adding all the numbers up to $\left\lfloor\frac97n\right\rceil$ except those with remainders $2$ and $7$ modulo $9$. So you have $\frac{\left\lfloor\frac97n\right\rceil\left(\left\lfloor\frac97n\right\rceil+1\right)}2$, but you need to subtract the missing numbers. There are $\left\lfloor\frac{n+5}7\right\rfloor$ missing numbers with remainder $2$, and they add up to $2\left\lfloor\frac{n+5}7\right\rfloor+9\cdot\frac{\left\lfloor\frac{n+5}7\right\rfloor\left(\left\lfloor\frac{n+5}7\right\rfloor-1\right)}2=\frac{\left\lfloor\frac{n+5}7\right\rfloor\left(9\left\lfloor\frac{n+5}7\right\rfloor-5\right)}2$, and similarly there are $\left\lfloor\frac{n+1}7\right\rfloor$ missing numbers with remainder $7$, and they add up to $7\left\lfloor\frac{n+1}7\right\rfloor+9\cdot\frac{\left\lfloor\frac{n+1}7\right\rfloor\left(\left\lfloor\frac{n+1}7\right\rfloor-1\right)}2=\frac{\left\lfloor\frac{n+1}7\right\rfloor\left(9\left\lfloor\frac{n+1}7\right\rfloor+5\right)}2$, so the sum is
$$
\frac12\left(\left\lfloor\frac97n\right\rceil\left(\left\lfloor\frac97n\right\rceil+1\right)-\left\lfloor\frac{n+5}7\right\rfloor\left(9\left\lfloor\frac{n+5}7\right\rfloor-5\right)\right)-\left\lfloor\frac{n+1}7\right\rfloor\left(9\left\lfloor\frac{n+1}7\right\rfloor+5\right)\;.
$$
