Source: Previous puzzle experience. Some parts used as Ken's Puzzle of the Day 2/10/94.
3. They also provided me with a full table to follow, showing what combinations of sticks to leave after each move in order to win the game for either winning or losing by taking the last stick. I decided not to show their table [yet; I'll probably show it later] to see if someone can come up with a more generic solution.
For example, what strategy should be followed if the number of sticks increased to 103, 105, and 107? Now, creating a table would be too cumbersome, but a strategy can be found.
The game of Nim was completely analyzed around the turn of the century; here's the general strategy: 1) Express the number of items in each pile in binary notation. (For 3, 5, 7 this is 011, 101, 111) 2) For each place, count the number of 1's in that position. (For 3, 5, 7, this is 223) 3) If the number of 1's in each column is even, then person about to move will lose; otherwise, he/she can win by making a move that will make all the values even. For the 103, 105, 107 case, the answer is: 103 = 1100111 105 = 1101001 107 = 1101011 Number in each column: 3302123 Need to remove 1100101 to make all digits even; Remove 101 from the first pile. In the case when last match loses, adjust the endplay when all but one/two piles have one marker.
He reports for the Extra section above: These references also explain how to play the game where you try to force your opponent to take the last stick. Basically, you play exactly the same way except that piles of one stick are treated as if they had no sticks in them.
He also mentions about 3-player Nim (11/25/98): Thinking about the three player Nim puzzle some more, I searched for some info and came up with the following paper, which is in publication but not yet published: http://www-math.mit.edu/~propp/three.ps which tells the general theory of three player Nim. It's pretty technical, though. The short summary is that except in obvious cases (one big pile or lots of piles with just one stick each, and a couple of other rare exceptions), there is no best possible strategy for any player playing alone. The best strategy is to gang up on the third player. Two people playing as a coalition against one can win in all cases which aren't constrained like I said in the parentheses.