Define a "mod sequence" of nonnegative integers based on one start parameter $s$, its first term, as follows. $A(s)=(a_1,a_2,\ldots,a_n,\ldots)$ with $a_1 = s$ and $$ a_n = \left(\sum_{k=1}^{n-1} a_k \right) \bmod n\;.$$

For example, $A(13)=(13, 1, 2, 0, 1, 5, 1, 7, 3, 3, 3, \ldots)$. Here is how this is obtained. Let $S(s)$ be the sums, $s_n=\sum_1^{n} a_k$. Then $S(13)=(13, 14, 16, 16, 17, 22, 23, 30, 33, 36, 39, \ldots)$. In detail, $$a_2 = 13 \bmod 2 = 1$$ $$a_3 = 14 \bmod 3 = 2$$ $$a_4 = 16 \bmod 4 = 0$$ $$a_5 = 16 \bmod 5 = 1$$ $$a_6 = 17 \bmod 6 = 5$$ $$a_7 = 22 \bmod 7 = 1$$ $$a_8 = 23 \bmod 8 = 7$$ $$a_9 = 30 \bmod 9 = 3$$ $$a_{10} = 33 \bmod 10 = 3$$ $$a_{11} = 36 \bmod 11 = 3$$ $$a_{12} = 39 \bmod 12 = 3$$ And all remaining terms are $3$.

Q1. For all $s \ge 1$, does $A(s)$ become a constant after some finite $n$, $a_n=c$?

Here is a bit more data, showing for each $s$ (first row), the constant reached (second row): $$\left( \begin{array}{ccccccccccccc} 1 & 2 & 3 & 4 & 5 & 6 & 7 & 8 & 9 & 10 & 11 & 12 & 13 \\ 97 & 97 & 1 & 1 & 2 & 2 & 2 & 2 & 316 & 316 & 2 & 2 & 3 \\ \end{array} \right)$$ The constant $316$ seems especially ubiquitous, always (apparently) reached at $a_{1241}=316$. For $s \le 50$, $316$ is reached for $$s=\{9,10,33,34,37,38,39,40,43,44,45,46,47,48,49,50\}\;.$$ For $s=9$, $s_{1241}=392472$ and $(392472 \bmod 1241) = 316$; then $s_{1242}=392788$ and $(392788 \bmod 1242) = 316$; etc.

Q2. What is special (if anything) about $316$?

**Addendum**. Here is an image that shows which $s$ map to which $a_n=c$, for all $s \le 100$. The upper-right cluster is $316$. The leftmost cluster is $13$, nearly as ubiquitous as $316$; so perhaps I misled to single out $316$....

each$m\geq 1$), and hence $p_{N+m}|(s_N+(m-1)c)$. But $p_{N+m}\sim (N+m)\log(N+m)$ while $s_N+(m-1)c\sim cm$, so the primes grow too fast to continue dividing. $\endgroup$ – Pace Nielsen Dec 27 '14 at 17:36