(Cross-posted to Math.SE: https://math.stackexchange.com/questions/2424395/counting-the-number-of-same-elements-in-a-sequence)
Let $\mathcal{E'}$ be the set of all sequences where:
Any element of $\mathcal{E'}$ is a subset of $\mathbb{N}\cup \{0\}=\mathbb{N}_0$.
In any element of $\mathcal{E'}$, every distinct number appears finitely many times.
Let $\mathcal{E}$ be the set of all elements of $\mathcal{E'}$ which are in non-decreasing order with entries from $\mathbb{N}_0$. (We define a function $A:\mathcal{E'}\rightarrow \mathcal{E}$, where $A$ rearranges a element of $\mathcal{E'}$ in non-decreasing order.) $(*)$
Now choose an element (say, $S$) from $\mathcal{E}$. Define a function $\rho$ on $\mathcal{E}$ by $\rho(S)=(f(n))_{n=0}^{\infty}$, where $f:\mathbb{N}_0\rightarrow \mathbb{N}_0$, with $f(n)=$ the number of times $n$ appeared in the sequence $S$.
Let $\mathcal{H}\subset \mathcal{E}$ be the set of all such $S\in \mathcal{E}$ for which $\rho(S)\in \mathcal{E'}$. Arranging elements of $\rho(S)$ in non-decreasing order, we will get an element of $\mathcal{E}$, which is $A(\rho(S))$. Essentially, if $A(\rho(S))\in \mathcal{H}$, we can get $\rho(A(\rho(S)))\in \mathcal{E'}$. Again, arranging elements of $\rho(A(\rho(S)))$ in non-decreasing order, we will get an element of $\mathcal{E}$, which is $A(\rho(A(\rho(S))))=(A\circ\rho)^2(S)$. We continue this process, and will get a set of sequences $((A\circ\rho)^m(S))_{m=0}^{\infty}\subset \mathcal{H}$ with $(A\circ\rho)^0(S)=\rho^0(S)=S$.
Questions:
Consider the set, $((A\circ\rho)^m(S))_{m=0}^{\infty}$. Let $N\in \mathbb{N}$. Can we find a $N$, for a given $S\in \mathcal{E}$ such that $(A\circ\rho)^N(S)=S$?
Can we find a $S\in \mathcal{E}$, for each $N\in\mathbb{N}$ such that $(A\circ\rho)^N(S)=S$?
What I want to know?
$(*)$ Actually I want to know whether such $A$ really exists or not. If not, can anyone give an alternative way to formulate the problem, if possible? I wrote the whole problem, if someone is interested to know what it is.