# Optimal Strategy for Card Split and Discard game

In a game of 2 players, there are 2 piles of cards.

In every turn, a player has to discard one pile and divide the other into two equal parts (as close as possible). The game ends when a player is not able to make a move. (That is discard and split)

What can be the optimal strategy for this game if the starting pile has m and n cards.

Eg: (4,5)

p1-> discard 4, split 5 (2,3)

p1 cannot move, p2 wins

Call $1$ a bad number. We will recursively construct further ranges of bad numbers: if $[a,b]$ is a (maximally contiguous) range of bad numbers, then so is $[2b+1,4b+1]$. Thus the bad numbers, organized in ranges, are: $$1,[3,5],[11,21],[43,85],\ldots$$
Addendum: As @Michael alludes to in his comment, these ranges are related to the powers of $2$; they can be written like so: $$\left[\frac{2^1+1}3,\frac{2^2-1}3\right],\left[\frac{2^3+1}3,\frac{2^4-1}3\right],\left[\frac{2^5+1}3,\frac{2^6-1}3\right],\ldots$$ Therefore a number $n$ is bad precisely when $\lfloor \log_23n \rfloor$ is odd.
• $2^n/3\,\,\,\,\,\,\,$ Commented Apr 18, 2016 at 7:22