Last night I found a puzzle. Here goes:

Two people are playing a game. The first says “January 1”. The second must say another day later in the year by changing either the month or the day, but not both. The goal is to say “December 31” to win. Given these rules and the first player’s choice of January 1, what should the second player do?

When I read the puzzle, Laralee rolled her eyes and grumbled about how she doesn’t like these sorts of things. But I started thinking about it (talking aloud as I did so) and before long she had a pencil and paper and was writing down my strategy. Spoiler alert ahead.

Since the winning move is December 31, we know that anyone who picks a day in December that’s not the 31st will lose. The next player will simply change the day (remember, only the day or month can be changed– not both) and score the win. That means all days in December except the 31st are losing moves.

Let’s step back a month. If I choose November 30, the other player can’t pick anything in November (since there are no days after the 30th) and must choose to change the month. That gives December 30, and my choice is then December 31. Thus November 30 is a winning move. It’s important to note that all other days in November are losing moves, because the other player simply chooses the 30th for the win.

Going back another month, consider October 31. That’s a losing move because the other player goes straight to December 31 for the win. Now consider October 30. Again, that’s a loser because the next move is November 30 which we’ve shown is a winner. How about October 29? If I choose that, you have four moves: you can then choose the 30th or 31st– both of which are losers. You could also choose November 29, again a loser. Finally, you could pick December 29, a loser. So we see that October 29 is a winning move. Any day in October after that is a loser, and anything before it means I choose the 29th for the win. So again, we’re left with a single day in October that’s a winner.

You can see the pattern. We step backward through the calendar, subtracting one each time, to find the winning days for each month. It’s important to note that every other day in the month is a loser, meaning these 12 days are the only winning days (assuming perfect play). Our list of winning moves looks like this:

December 31 (duh)
November 30
October 29
September 28
August 27
July 26
June 25
May 24
April 23
March 22
February 21
January 20

In that we have our answer. If the first player selects January 1, the second player selects January 20 and is guaranteed a win. After some thought, Laralee and I determined that leap years don’t change anything– choosing February 29 will lead to October 29 for the win.

The funny thing is when we were finished, Laralee (grudgingly) admitted that solving the puzzle was, in fact, kind of cool.