Problem

Source: Olympiad

Tags: combinatorics, number theory



Let $n$ be a positive integer, the players A and B play the following game: we have $n$ balls with the numbers of $1, 2, 3, 4,...., n$ this balls will be in two boxes with the symbols $\prod$ and $\sum$. In your turn, the player can choose one ball and the player will put this ball in some box, in the final all the balls of the box $\prod$ are multiplied and we will get a number $P$, after this all the balls of the box $\sum$ are added up and we will get a number $Q$(if the box $\prod$ is empty $P = 1$, if the box $\sum$ is empty $Q = 0$). The player(s) play alternately, player A starts, if $P + Q$ is even player A wins, otherwise player B wins. a)If $n= 6$, which player has the winning strategy??? b)If $n = 2012$, which player has the winning strategy???