Note: The following question is based on a discussion I had in the comments of this question. The function I'll define is a generalization of the function given in that problem.
Fix some $n$. Then define the function $f_n : \mathbb{N}^n \to \mathbb{N}^n$ on $n$-tuples of natural numbers as follows:
- The first element of $f_n(\bf{x})$ is the number of distinct values appearing in the tuple $\bf{x}$.
- For $j > 1$, the $j$th element of the tuple $f_n(\bf{x})$ is the number of times $j-2$ appears in $\bf{x}$.
So, the second element of the tuple $f_n(\bf{x})$ is the number of zeroes in $\bf{x}$, the third element is the number of ones, and so on. As an example of computing this function, consider $$f_5(2, 3, 2, 0, 0) = (3, 2, 0, 2, 1)$$ The $3$ in the answer comes from there being three distinct digits in the input $\{0, 2, 3\}$. The next elements come from: "there are two 0's in the input", "there are zero 1's in the input", "there are two 2's in the input", and "there is one 3 in the input".
Now, the question is: what are the fixed points of this function $f_n$, i.e. what values of $\bf{x}$ make $f_n(\bf{x}) = \bf{x}$?
We can immediately reduce this problem to a finite number of cases, because everything in the image of $f_n$ consists only of tuples whose maximum value is $n$. That is to say, we can compute the fixed points directly. Now, I've written a handy script to compute all of the fixed points for $n \leq 30$, and it's from this that I want to present the theorem. $n \leq 11$ seems to be mostly chaos, but when $n \geq 12$, a pattern starts to emerge.
Theorem: For $n \geq 12$, there are exactly two fixed points of $f_n$. The two fixed points are exactly $\bf{x}$ and $\bf{y}$ as follows:
- ${\bf x} = (5, n - 6, 3, 0, 1, 0, 1, \dots, 1, 0, 0, 0, 0)$
- ${\bf y} = (5, n - 6, 2, 2, 0, 0, 1, \dots, 1, 0, 0, 0, 0)$
where the omitted $(\dots)$ consists only of zeroes.
As I said, I've verified this on the computer for $12 \leq n \leq 30$. It would be interesting to have a general proof of this statement, or a refutation.