Alice and Bob play a number game. Starting with a positive integer $n$ they take turns changing the number with Alice going first. Each player may change the current number $k$ to either $k-1$ or $\lceil k/2\rceil$. The person who changes $1$ to $0$ wins. Determine all $n$ such that Alice has a winning strategy.
Problem
Source:
Tags: ceiling function, combinatorics unsolved, combinatorics
28.06.2014 13:28
My answer: 1 is winning, 2 is losing. For above 2: If even, automatic winning If odd and not one plus a power of 2, consider the exponent of the highest power of 2 that divides that number minus 1. If that exponent is odd, then losing. If even, then winning. Now for one plus a power of 2, follow the same rule for odd numbers, just reverse the outcome. Really ugly problem.
29.06.2014 15:14
The closed form of all winning numbers is: $1, 2 \times 4^k+1, 3 \times 4^k+1, (2l+5) \times 4^k+1$, where $k, l \geq 0$. Not going to prove it here. But the idea is for sufficiently large $n$, $4n-3$ is the same type as $n$.
29.06.2014 18:46
Isn't it $2n-1$ is ALWAYS same type as n?
29.06.2014 18:54
For sufficiently large $n$ ($\ge 2$), $2n-1$ is always of a different type from $n$.
30.06.2014 07:53
Oops... Yeah, but is my answer set corect?
30.06.2014 07:58
Most likely yes.
09.01.2015 16:44
Is there an "easy" formula?
09.01.2015 20:02
All letters in the sequel symbolize integers. I claim the set $L$ of losing positions is $L=\{2\}\cup L_1\cup L_2$, where $L_1 = \{2^{2a+1}(2b+1) +1 \mid a\geq 0, b > 0\}$ and $L_2 = \{2^{2(a+1)} +1 \mid a \geq 0\}$. I will also denote by $W = \{1,2,3,\ldots\} \setminus L$ the set of winning positions. Indeed, for $\ell \in L$ we have $\ell - 1 \in W$; for $\ell \in L_1$ we have $\lceil \ell/2 \rceil = 2^{2a}(2b+1) +1 \in W$ and for $\ell \in L_2$ we have $\lceil \ell/2 \rceil = 2^{2a+1}+1 \in W$. Let us now work with $w\in W$. For $w=1$ we have $w-1 = 0$. For $w>1$ odd we have $w=2^k(2b+1)+1$ for some $k > 0$ and $b\geq 0$. $\bullet$ For $k=2(a+1)$ ($a \geq 0$) we thus have $b>0$, and $\lceil w/2 \rceil = 2^{2a+1}(2b+1) +1 \in L_1$; $\bullet$ For $k=2a+1$ ($a \geq 0$) we thus have $b=0$, and $\lceil w/2 \rceil = 2^{2a} +1 \in \{2\}\cup L_2$. For $w>1$ even we have $w=2^k(2b+1)$ for some $k > 0$ and $b\geq 0$. $\bullet$ For $k = 1$ we must have $b>0$, and $w -1 = 4b +1$, $\lceil w/2 \rceil = 2b+1$. Say $2b = 2^\alpha(2\beta+1)$, for some $\alpha > 0$ and $\beta \geq 0$. Then, for $\alpha$ odd and $\beta>0$ we have $\lceil w/2 \rceil \in L_1$; for $\alpha$ even and $\beta=0$ we have $\lceil w/2 \rceil\in L_2$; for $\alpha$ odd and $\beta=0$ we have $w-1\in L_2$; for $\alpha$ even and $\beta>0$ we have $w-1\in L_1$; $\bullet$ For $k=2$ and $b=0$ we have $\lceil w/2 \rceil = 2$, while for $k=2$ and $b>0$, or for $k > 2$, we have $w-1 = 2^{k}(2b+1) -1 = 2(2(2^{k-2}(2b+1) -1)+1) + 1\in L_1$, since $2^{k-2}(2b+1) -1>0$. Thus the conditions for losing and winning positions are verified (from any losing position any move reaches a winning position, while from any winning position there is a move that reaches a losing position). To establish if $n$ is losing, factorize $n-1$.