(a) The following table shows how Joe can win the game in three turns:
RGGGRGRGRGRGRGRGRRGGRRRG Start After 1 turn After 2 turns After 3 turns
On Joe's first turn, he turns over the first 4 cards.
On Joe's second turn, he turns over cards 2 through 5.
On Joe's third turn, he turns over the four red cards.
(b) There are many sequences of moves in which Joe can win.
Suppose that Joe takes 9 turns. On turn 1, he turns over cards 1, 2, 3, 4, 5. On turn 2, he turns over cards 2,3,4,5,6.
He continues in this way so that, on each turn, he turns over five consecutive cards starting with the t th card on turn t, with the understanding that card 1 comes after card 9 . This means, for example, that on turn 7, Joe turns over cards 7,8,9,1,2.
In this way, each of the 9 cards is turned over 5 times (once as each of the 1st, 2nd, 3rd, 4 th, 5 th card in the sequence).
Since each card is turned over an odd number of times, its final colour is the opposite of the starting colour, and so it is green.
We demonstrate this in the following chart:
| R | R | R | R | R | R | R | R | R | Start |
| :--- | :--- | :--- | :--- | :--- | :--- | :--- | :--- | :--- | :--- |
| G | G | G | G | G | R | R | R | R | After 1 turn |
| G | R | R | R | R | G | R | R | R | After 2 turns |
| G | R | G | G | G | R | G | R | R | After 3 turns |
| G | R | G | R | R | G | R | G | R | After 4 turns |
| G | R | G | R | G | R | G | R | G | After 5 turns |
| R | R | G | R | G | G | R | G | R | After 6 turns |
| G | G | G | R | G | G | G | R | G | After 7 turns |
| R | R | R | R | G | G | G | G | R | After 8 turns |
| G | G | G | G | G | G | G | G | G | After 9 turns |
Joe can actually finish in as few as three turns:
RGGGRGGGRGRGRGRGRGRGRRGGRRGGRRRGRRRG Start After 1 turn After 2 turns After 3 turns
(c) Suppose that n=2017. This means that Joe has 2017 cards.
We show that Joe can win the game when k is odd and cannot win the game when k is even.
Suppose that k is odd.
Suppose that Joe takes 2017 turns.
For each t=1,2,3,…,2016,2017, Joe turns over the k cards starting at card t, and with the understanding that card 1 comes after card 2017.
In this way, each of the 2017 cards is turned over k times, once for each "position" in a sequence of k consecutive cards.
Since k is odd, then the colour of each of the 2017 cards is reversed at the end, and so each is green.
In this way, Joe wins the game when k is odd.
Suppose that k is even.
For Joe to win the game, each of the 2017 cards must be turned over an odd number of times in order to reverse its colour.
This means that the total number of card flips is odd, since this total is the sum of 2017 odd integers (the number of flips for each of the 2017 cards).
For any positive integer t, after t turns, Joe has flipped a total of tk cards ( k on each of t turns).
Since k is even, then tk is even.
Therefore, after any number of turns, the total number of card flips is always even and so cannot be the odd number of flips necessary to reverse the colour of all of the cards.
Therefore, when k is even, Joe cannot win the game.
In summary, when n=2017, Joe can win the game for all odd k with 1≤k<2017 and cannot win the game for all even k with 1≤k<2017.