Factor Game Calculation

135 Views Asked by At

Game: There are two players. The game starts off with the numbers 1 - 30 and player1 chooses a number and gets that number added to their score; however, the sum of all the available factors of that number get added to player2's score, and all the numbers involved are crossed out from play. Repeat until entire board has no more available options.

1   2   3   4   5   6
7   8   9   10  11  12
13  14  15  16  17  18
19  20  21  22  23  24
25  26  27  28  29  30

Example: If player1 choose 30 then player1 gets 30 added to their score, and then player2 gets 1+2+3+5+6+10+15=42 (sum of the factors of 30) added to their score. All the numbers involved are all crossed out from play.

Question: I'm trying to figure out the total number of options the game has in total if its played in every possible way.

What I've done so far:

If we scale down the game to different sizes from [1, 2, 3, 4 ... N]

Game with 1 number: 1 option

Game with 2 numbers: 3 options (if you don't see this then draw out a tree and count all the leaves/nodes)

Game with 3 numbers: 11 options

Game with 4 numbers: 26 options

Game with 5 numbers: 92 options

I drew out the tree for each one using the games rules and that's the number of options scaled down to that size. I know the game is going to have something less than N! because the game eliminates factors from play depending on what you choose.

I tried to make a discrete problem out of it by doing:

Suppose: [1, 2, 3, 4 ... N]

N = size of array
n = number chosen
S = number of available factors of (n)

once we choose a number then we get a smaller array depending on choice of number
[1, 2, 3, 4 ... N - S(n)]

I don't know how to take it further than this. Once I figure this out discretely I should be able to scale it to a game of size 30 or any size for that matter!

I hope I explained this well!

1

There are 1 best solutions below

6
On BEST ANSWER

If I understand correctly what the OP is trying to count, then the numbers $11$, $26$, and $92$ for $N=3$, $4$, and $5$, respectively, are wrong. They should instead be $10$, $31$, and $150$.

In particular, for $N=3$, the possible ways of playing the game can be written as $32$, $23$, $132$, and $123$, where "$abcd...$" means that player1 takes $a$ on the opening move (thus giving player2 all the smaller factors of $a$, which eliminates all these numbers from further play), player2 responds by taking $b$, then player1 takes $c$, and so forth. Thus there are $2$ ways to play the game with $2$ moves and another $2$ ways that take $3$ moves. The OP seems to want the total $2\cdot2+2\cdot3=10$.

For $N=4$, here's a list of all the games:

$$\begin{align} &43\\ &34\\ &324\\ &243\\ &234\\ &143\\ &134\\ &1324\\ &1243\\ &1234 \end{align}$$

for which the relevant total seems to be

$$2\cdot2+5\cdot3+3\cdot4=31$$

Finally, here's half the list for $N=5$:

$$\begin{align} &543\\ &534\\ &5324\\ &5243\\ &5234\\ &453\\ &435\\ &354\\ &3524\\ &345\\ &3254\\ &3245\\ &2543\\ &2534\\ &2453\\ &2435\\ &2354\\ &2345\\ \end{align}$$

The other half repeats this list with a "$1$" at the beginning. Note that the half list shown has $6$ games with $3$ moves and $12$ games with $4$ moves, for a total of $6\cdot3+12\cdot4=66$. The second half list will have all these moves again plus another $6+12=18$ moves corresponding to the $1$'s, which gives an overall total of $2\cdot66+18=150$.

In general, there will be $G(N)$ different games when you start with $N$, with an overall total of $M(N)$ moves. If we let $g(N)$ and $m(N)$ denote the corresponding counts for games in which player1 does not start by taking $1$, then, for $N\ge2$, we have

$$G(N)=2g(N)\quad\text{and}\quad M(N)=2m(N)+g(N)$$

(Note, these relations don't hold for $N=1$, since $g(1)=m(1)=0$ but $G(1)=M(1)=1$. But of course $N=1$ isn't much of a "game"!)

We thus have four sequences of potential interest:

$$\begin{align} g:\quad&1,2,5,18,\ldots\\ m:\quad&1,13,66,\ldots\\ G:\quad&2,4,10,36,\ldots\\ M:\quad&3,10,31,150,\ldots\\ \end{align}$$

The OEIS gives hits on the first three of these, most of which will undoubtedly be eliminated with the next term (corresponding to $N=6$); it already fails (at the moment) to recognize the sequence for $M(N)$. That doesn't prove anything, of course, but it suggests there may be no easy answer for what I take to be the OP's question.

As an aside, it's worth noting that the OP's factor game is provably non-losing for player1, because of strategy stealing: player1 always has the option of taking $1$ on the opening move, so if all other options would lead to losses (under perfect play), then player1 should take the $1$, which, in effect, turns the tables on player2, forcing player2 to "open" with a losing move. (As in Hex, this argument is non-constructive: it doesn't help identify player1's best moves, it just says he/she always has one.) Note that player1 can at best tie when $N=3$ and $4$, and should take either $1$ or $3$ when $N=3$ and either $1$, $2$, or $3$ when $N=4$. (Note also that $N=5$ must be winning for player1, since $1+2+3+4+5=15$ is an odd number, so the game cannot result in a tie.)