Lemma 1. For any set S, S wins if and only if J(S,∅) wins. Similarly, S wins if and only if J(∅,S) wins.
Proof. Let (k,m) be a move on S, and let T be the result of applying the move. Then we can reduce J(S,∅) to J(T,∅) by applying the move (k+1,2m−1).
Conversely, let (k,m) be a move on J(S,∅). We can express the result of this move as J(T,∅) for some T. Then we can reduce S to T by applying the move (max(k−1,0),(k+1)/2).
This gives us a natural bijection between games starting with S and games starting with J(S,∅) and thus proves the first part of the lemma. The second part follows by a similar argument. □
Lemma 2. If S and T are nonempty and at least one of them loses, then J(S,T) wins.
Proof. If S is losing, then we can delete J(∅,T) using the move (1,t) for some t∈J(∅,T), which leaves the losing set J(S,∅). Similarly, if T is losing, then we can delete J(S,∅) using the move (1,s) for some s∈J(S,∅), leaving the losing set J(∅,T). □
Lemma 3. If S is nonempty and wins, then J(S,S) loses.
Proof. From this position, we can convert any sequence of moves into another valid sequence of moves by replacing (k,2n−1) with (k,2n), and vice versa. Thus we may assume that the initial move (k,m) has m odd. We want to show that any such move results in a winning position for the other player.
The move (0,m) loses immediately. Otherwise, the move results in the set J(T,S) for some set T. There are three cases.
If T is empty then the other player gets the winning set J(∅,S).
If T is losing then the other player can choose the move (1,s) for some s∈J(∅,S), which leaves the losing set J(T,∅).
If T is nonempty winning then the other player can choose the move (k,m+1), which results in the position J(T,T). We can then proceed by induction on ∣S∣ to show that this is a losing set. □
Lemma 4. [2n] wins if and only if [n] loses.
Proof. Note that [2n]=J([n],[n]). The result then follows directly from the previous two lemmas. □
Lemma 5. For any integer n⩾1, [2n+1] wins.
Proof. By Lemma 4, either [n] or [2n] loses. If [n] loses, then by Lemma 2 we have that [2n+1]=J([n+1],[n]) wins. Otherwise, [2n] loses, and therefore [2n+1] wins by choosing the move (k,2n+1) for sufficiently large k so that only 2n+1 is eliminated. □
It remains to verify the original answer. We have two cases to consider:
- Suppose N=2n for some n. For N=1, every move is an instant loss for Geoff. Then by Lemma 4, Geoff wins for N=2n if and only if Geoff loses for N=2n−1, and thus by induction we have that Geoff wins for N=2n if and only if n is odd.
- Otherwise, N=t2n, for some n and some t>1 with t odd. By Lemma 5, Geoff wins when n=0. Then by Lemma 4, Geoff wins for N=t2n if and only if Geoff loses for N=t2n−1, and thus by induction on n we have that Geoff wins for N=t2n if and only if n is even.