TITLE: $\sum_{k=1}^{n} \arcsin(\sin(k))= a_n+b_n \pi$, for $a_n,b_n\in\mathbb{Z}$; what can be said about the sequence $(a_n,b_n )$?
QUESTION [6 upvotes]: We have $\sum_{k=1}^{n} \arcsin(\sin(k))= a_n+b_n \pi$ for some integers $a_n,b_n$. I have several questions about the behavior of these numbers:

For which $n$ does $b_n=0$ and $a_n\ne 0$, i.e. the sum is a non-zero integer?
For which $n$ does $(a_n,b_n)=(0,0)$, i.e. the sum vanishes?
Aside from these subsequences, based on numerical evidence I conjecture that $\lim_{n\to\infty} a_n/b_n=-\pi$, but I don't know how to prove it.


Recall the convergents of $\pi$ are $3, 22/7, 333/106, 355/113, 103993/33102$, etc. I computed $(a_n,b_n)$ for $1\le n\le 120000$ and here's what I found:

As expected, I saw 'increased aberrations' for $n$ near the numerator of the numerators of the convergents. For example, $b_n=0$ and $a_n\ne 0$ when $$n=\{1,8,16,52,60,96,104,140,148,184,192,228,236,272,280,316,324,360,103632,103668,103676,103712,103720,103756,103764,103800,103808,103844,103852,103888,103896,103932,103940,103976,103984\}$$ and $(a_n,b_n)=(0,0)$ when $$n=\{24,44,68,88,112,132,156,176,200,220,244,264,288,308,332,352,103640,103660,103684,103704,10372
   8,103748,103772,103792,103816,103836,103860,103880,103904,103924,103948,103968,103992\}.$$ In particular, when $b_n=0$ and $a_n \ne0$, aside from $n=1$ I found that $a_n=2$.
Aside from these values, the ratio is quite close to $\pi$. We have $a_{120000}/b_{120000} =-\frac{248162}{78993}$, which differs from $-\pi$ by about $0.0000231474$. Here is a plot:


Any information or insight would be much appreciated. I've heard of several continued fractions for $\pi$ and was wondering if perhaps this has to do with that.
Update: I checked oeis.org for both the numerator and denominator and found nothing. Since $\arcsin(\sin(k))=x_k+y_k \pi$, $x_k,y_k\in\mathbb{Z}$, is essentially the signed distance between $k$ and its nearest multiple of $\pi$, it is is clear that $x_k/y_k\approx -\pi$. Then perhaps using the CLT or another probabilistic argument, one could examine the convergence of the random variable $a_n/b_n$.

REPLY [3 votes]: This may help:
$$\arcsin(\sin(x)) = |((x-\pi/2) \bmod (2\pi))-\pi|-\pi/2$$
or equivalently
$$\arcsin(\sin(x)) = \left|x-3\pi/2 -2\pi\left\lfloor\frac{x-\pi/2}{2\pi}\right\rfloor\right|-\pi/2$$
If we write $\arcsin(\sin(k)) = x_k + y_k \pi$ with $x_k, y_k \in \mathbb Z$ we have $$x_k =\operatorname{sgn}(\cos(k))\,k$$ and $$y_k=-\operatorname{sgn}(\cos(k))\left(\frac{3}{2}+2\left\lfloor\frac{k-\pi/2}{2\pi}\right\rfloor\right)-\frac{1}{2}$$