Ann and Bob play alternately on a pile of chips. On each play, either 1, 2 or 3 chips can be removed except if the number of chips is a prime number. In that case either 1, 2, 3, 4 or 5 chips can be removed.The person, who removes the last chip is the winner. There are 100 chips on the pile. Ann starts. Determine a winning strategy for one of the players.
It seems like you force a win if you can leave behind a multiple of 4. So the first player is guaranteed to lose because he cannot leave behind a multiple of 4. Whatever amount player 1 takes (x), player 2 should take 4 - x.
Here's a little Python program to test it yourself:
And here's C++ code written by user @im_so_meta_even_this_acronym