Two players play a game starting with a pile of n stones. The players take turns removing stones from the pile. On their turn they are allowed to remove 1 stone from the pile, 2 stones from the pile, or half the stones from the pile, provided the number of stones in the pile is even. The player who wins is the player who makes the last move (i.e. removes the last stone). If the values of n can be any number from 1 to 500, determine for how many of these games the first player can win the game if he plays optimally.
if n=1 the first player will win if n=2 the first player will win if n=3 the second player will win
if n=4 the first player can win if take one stone on their first go
if n=5 the first player must take two on their first go , then they can win
Join our real-time social learning platform and learn together with your friends!