I had the following question $\sum_{r=1}^{5}\arcsin(\sin(2r-1))$ which comes out to be $1$ by writing all the terms, which is a tedious task. I am wondering if this can be generalised for sum to $n$.
$$\sum_{r=1}^{n}\arcsin(\sin (2r-1))$$
Consider $a_r=2r-1$ which is an arithmetic progression with common difference $2$. And the piecewise definition changes each time $2r-1$ enters the interval $(k\pi/2,(k+2)\pi/2) ,k\in\mathbb{Z}$. Also the function $\arcsin(\sin x)$ in this interval is equivalent to the following piecewise function where $2\epsilon=k+1$.
$$\arcsin(\sin x)=\begin{cases}x-\epsilon \pi, \epsilon =2\lambda ,\lambda\in\mathbb{Z}\\ \epsilon\pi-x, \epsilon =2\lambda -1, \lambda\in\mathbb{Z}\end{cases}$$
$a_r$ enters a new interval which are at steps of $\pi$, and the number of numbers it takes to reach the next interval changes as the numbers get progressively larger. Is there a way to express this sum in a closed form? Any hints are appreciated. Thanks.