Does there exist a general solution of this 'Counting numbers' game?

Solution 1:

This is not an answer to all of your above questions. I attempt to formalize the problem thereby getting some insight into the structure of the solution. To that purpose let $D:=\{1,\ldots,9\}$ and $i\in D$. Consider the system of equations

$ x_i = c_i + \sum_{j\in D} \delta_{x_j,i} $

with $\delta_{i,j}$ being the Kronecker delta. Your question 2 now translates to

Q2: Does this system have solutions $x_i\in D$ for given $c_i\in D$?

I understand @Nick R s comment in such a way that one can disprove existence for all inital values $c$ by a diagonal argument. However, for some choices of $c_i$ a solution might exist and your question 1 is to find such a solution without searching through all possibilities. Lets try to tackle that.

By summing we get the invariant

$ I := \sum_{i\in D} x_i = 10 + \sum_{i\in D}c_i $

and inequalities like e.g.

$ i x_i + (1-\delta_{x_i,i}) x_i \leq I. $

This can be used to reduce the search space considerably. In your example we have $c_0 := 2, c_1 := 4, c_2 := 2, c_3 := 2, c_4 = 1, c_5 = 1, c_6 = 1, c_7 = 1, c_8 = 2$ and $c_9 = 1.$ That yields $ I = 27 $. Since all of the $c_i$ are greater than zero we find $x_0 = 2$. The inequalities lead to strong constraints for large $i$. Let us consider $i=9$. We get

$ 9 x_9 + (1-\delta_{x_9,9}) x_9 \leq 27. $

This excludes $x_9 = 9$ and therefore $\delta_{x_9,9}=0$. Together with $x_i\geq c_i$ and since $x_i\in D$ we get

$ 1\leq x_9\leq 2. $

Admittedly I have not yet tried to tackle the whole problem, but it might be feasible to be solved with this strategy without a computer. Especially since the inequalities can probably with a little work be optimized.

Your last question about reasonable generalisations of the game can now be partially answered with help of the above formalism. One could e.g. use a different base $D$ or adjust the above equations for $x_i$ to have more than one digit.