$n$ is a positive integer. Than we can write this.
$$\lfloor n/2 \rfloor= \left(n+\frac{(-1)^{n}-1}{2}\right)\frac{1}{2}$$
I wonder can we do that simplifying with other dividers? Like can we do the similar thing to $\lfloor n/3 \rfloor$?
$n$ is a positive integer. Than we can write this.
$$\lfloor n/2 \rfloor= \left(n+\frac{(-1)^{n}-1}{2}\right)\frac{1}{2}$$
I wonder can we do that simplifying with other dividers? Like can we do the similar thing to $\lfloor n/3 \rfloor$?
We obtain a formula for $\left\lfloor\frac{n}{p}\right\rfloor$ using the $p$-th root of unity \begin{align*} \omega_j=e^{\frac{2j\pi i}{p}}\qquad\qquad 0\leq j \leq p-1 \end{align*}
$$ $$
Example: $p=4$
\begin{align*} \left\lfloor\frac{n}{4}\right\rfloor&=\frac{n}{4}- \begin{cases} 0&\qquad n\equiv 0(\bmod\,4)\\ \frac{1}{4}&\qquad n\equiv 1(\bmod\,4)\\ \frac{2}{4}&\qquad n\equiv 2(\bmod\,4)\\ \frac{3}{4}&\qquad n\equiv 3(\bmod\,4)\\ \end{cases}\\ &=\frac{n}{4}-\frac{1}{4}S(n-1,4)-\frac{2}{4}S(n-2,4)-\frac{3}{4}S(n-3,4) \end{align*}
Since \begin{align*} \sum_{k=1}^{p-1}kx^k&=x\sum_{k=0}^{p-1}kx^{k-1}=x\frac{d}{dx}\sum_{k=0}^{p-1}x^k =x\frac{d}{dx}\frac{1-x^p}{1-x}\\ &=\frac{(p-1)x^{p+1}-px^p+x}{(1-x)^2} \end{align*}
Let's look at the formula for small $p=2,3,4$