Let $S(n)$ be the sequence whose first element is $n$, and from then onward, the next element is the smallest natural number ${\ge}1$ that ensures that the mean of all the numbers in the sequence is an integer.
For example, the second element of $S(4)$ cannot be $1$ (mean $\frac{5}{2}$), but $2$ works: $S(4)=4,2,\ldots$. Then the third element cannot be $1$ (mean $\frac{7}{3}$) or $2$ (mean $\frac{8}{3}$), but $3$ works: $S(4)=4,2,3,\ldots$. And from then on, the elements are all $3$'s, which I'll write as $S(4)=4,2,\overline{3}$.
Here are a few more examples: $$S(1)=1,\overline{1}$$ $$S(2)=2,2,\overline{2}$$ $$S(3)=3,1,\overline{2}$$ $$S(4)=4,2,\overline{3}$$ $$S(5)=5,1,\overline{3}$$ $$S(11)=11,1,3,1,\overline{4}$$ $$S(32)=32,2,2,4,5,3,1,\overline{7}$$ $$S(111)=111,1,2,2,4,6,7,3,8,6,4,2,\overline{13}$$ $$S(112)=112,2,3,3,5,1,7,3,8,6,4,2,\overline{13}$$ $$S(200)=200,2,2,4,2,6,1,7,1,5,1,9,7,5,3,1,\overline{16}$$
Has anyone studied these sequences? Is there a simple proof that each sequence ends with a repeated number $\overline{m}$? Is there a way to predict the value of $m$ from the start $n$ without computing the entire sequence up to $\overline{m}$? Might it be that the repeat value $m=r(n)$ satisfies $r(n+1) \ge r(n)$?
This question occurred to me when thinking about streaming computation of means, a not-infrequent calculation (e.g., computing mean temperatures).
Added, supporting the discoveries of several commenters: $r(n)$ red, and now fit with $1.135 \sqrt{n}$ blue for $n\le 10000$:
As per Eckhard's request, with Will's function $\sqrt{4n/3} -1/2$: