| 75 | ![]() |
50 | ![]() |
46 | ![]() |
30 | ![]() |
5 | ![]() |
4 | ![]() |
0 |
|
|
0 |
1 |
2 |
3 |
4 |
5 |
|
![]() |
![]() |
|
If the first player can make a move, such that the resulting number is losing, then n is a winning number.
Otherwise, each of the first player's move results in a winning number, hence n is a losing number. |

To give a feel of how the above guidelines work, suppose we have continued our analysis for table 1 till n=21 :
Table 2
|
0 |
1 |
2 |
3 |
4 |
5 |
6 |
7 |
8 |
9 |
10 |
![]() |
![]() |
![]() |
![]() |
![]() |
|
11 |
12 |
13 |
14 |
15 |
16 |
17 |
18 |
19 |
20 |
21 |
![]() |
![]() |
![]() |
![]() |


Making Good Moves
It is not enough to simply know whether each number is winning or losing. We must know how to make 'good' moves, so that we can win when placed in an advantageous situation.|
Example 1 : In the game with n=19, what is the first move you should make? Answer : Look at Table 2 above, 19 is a winning number which spells good news for you. Now consider the options you have : n=18, 15, 10, or 3. Since you want your opponent to lose, you should give him a losing number : i.e. n=10 or 15. |
|
Example 2 : In the game with n=18, the first player decided to subtract 4, leaving n=14. What would happen? Answer : Again, from Table 2, we see that 14 is a winning number - hence the first player's move was unwise. The second player may now turn the tables around by subtracting 4, leaving a losing number n=10 for the first player. Victory! |
Here, we shall describe an even more efficient method to find the outcome of a number n. This method is similar to the sieve of Eratosthenes (which finds all primes below a certain range). Suppose we wish to compute the outcomes of all numbers up to 15. We know for sure that 0 is a losing number :
|
0 |
1 |
2 |
3 |
4 |
5 |
6 |
7 |
8 |
9 |
10 |
11 |
12 |
13 |
14 |
15 |
16 |
17 |
|
|
Adding square numbers to 0 gives us 1, 4, 9 (which are winning numbers since there is a choice for player A to leave a losing number).
|
0 |
1 |
2 |
3 |
4 |
5 |
6 |
7 |
8 |
9 |
10 |
11 |
12 |
13 |
14 |
15 |
16 |
17 |
|
|
![]() |
![]() |
![]() |
![]() |
So we know that the first unlabelled number is losing (2 in this case) :
|
0 |
1 |
2 |
3 |
4 |
5 |
6 |
7 |
8 |
9 |
10 |
11 |
12 |
13 |
14 |
15 |
16 |
17 |
|
|
|
|
|
|
|
Adding square numbers to 2 gives us more winning numbers : (2+1, 2+4, 2+9) :
|
0 |
1 |
2 |
3 |
4 |
5 |
6 |
7 |
8 |
9 |
10 |
11 |
12 |
13 |
14 |
15 |
16 |
17 |
|
|
|
|
|
|
|
|
|
|
The next unlabelled number 5 must be losing. Continuing in this manner, we eventually obtain :
|
0 |
1 |
2 |
3 |
4 |
5 |
6 |
7 |
8 |
9 |
10 |
11 |
12 |
13 |
14 |
15 |
16 |
17 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|

|
Example 3 : Uh-oh, now I'm left with the number n=17,
which is a losing number. There's no hope for me now, is there?
Answer : Don't panic. Although in theory a losing position is a sure-lose case, you can bet that your opponent isn't well-versed enough to find the exact strategy. Hence, your next move should serve to confuse your opponent as much as possible. In your example, it would be daft to take away 1 leaving 16, since 16 is such a clear-cut case for your opponent. In short, we want to find a move to a winning position for the opponent which is as remote from the winning goal as possible. |
| WIN QUICKLY. LOSE SLOWLY. |
|
0 |
1 |
2 |
3 |
4 |
5 |
6 |
7 |
8 |
9 |
10 |
11 |
12 |
13 |
14 |
15 |
16 |
17 |
| 0 | 1 | 2 | 3 | 1 | 2 | 3 | 4 | 5 | 1 | 4 | 3 | 6 | 7 | 3 | 4 | 1 |

![]() |
| 11 | ![]() |   |   |   |   |   |   |   |   |   |   | ![]() |
| 10 | ![]() |   |   |   |   |   |   |   |   |   | ![]() |   |
| 9 | ![]() |   |   |   |   |   |   |   |   | ![]() |
  |   |
| 8 | ![]() |   |   |   |   |   |   |   | ![]() |   |   |   |
| 7 | ![]() |   |   |   |   |   |   | ![]() |   |   |   |   |
| 6 | ![]() |   |   |   |   |   | ![]() |   |   |   |   |   |
| 5 | ![]() |   |   |   |   | ![]() |   |   |   |   |   |   |
| 4 | ![]() |   |   |   | ![]() |
  |   |   |   |   |   |   |
| 3 | ![]() |   |   | ![]() |   |   |   |   |   |   |   |   |
| 2 | ![]() |   | ![]() |   |   |   |   |   |   |   |   |   |
| 1 | ![]() |
![]() |   |   |   |   |   |   |   |   |   |   |
| 0 | ![]() | ![]() |
![]() | ![]() |
![]() | ![]() |
![]() | ![]() |
![]() | ![]() |
![]() |
|
| 0 | 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 |
| 11 | ![]() | ![]() |
![]() |
  |   |   |   |   |   |   | ![]() | ![]() |
| 10 | ![]() | ![]() |
![]() |   |   |   |   |   |   | ![]() |
![]() | ![]() |
| 9 | ![]() | ![]() |
![]() |   |   |   |   |   | ![]() | ![]() |
![]() |   |
| 8 | ![]() | ![]() |
![]() |   |   |   |   | ![]() |
![]() | ![]() |
  |   |
| 7 | ![]() | ![]() |
![]() |   |   |   | ![]() |
![]() | ![]() |   |   |   |
| 6 | ![]() | ![]() |
![]() |   |   | ![]() | ![]() |
![]() |   |   |   |   |
| 5 | ![]() | ![]() |
![]() |   | ![]() | ![]() |
![]() |
  |   |   |   |   |
| 4 | ![]() | ![]() |
![]() |
![]() | ![]() | ![]() |
  |   |   |   |   |   |
| 3 | ![]() | ![]() | ![]() |
![]() | ![]() |
  |   |   |   |   |   |   |
| 2 | ![]() | ![]() | ![]() |
![]() | ![]() |
![]() | ![]() |
![]() | ![]() |
![]() | ![]() |
|
| 1 | ![]() | ![]() | ![]() | ![]() |
![]() | ![]() |
![]() | ![]() |
![]() | ![]() |
![]() |
|
| 0 | ![]() | ![]() | ![]() | ![]() |
![]() | ![]() | ![]() |
![]() | ![]() | ![]() | ![]() |
|
| 0 | 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 |
| 11 | ![]() | ![]() | ![]() |
![]() |   | ![]() |
  |   |   | ![]() | ![]() |
![]() |
| 10 | ![]() | ![]() | ![]() |
![]() |   | ![]() |
  |   | ![]() | ![]() |
![]() | ![]() |
| 9 | ![]() | ![]() | ![]() |
![]() |   | ![]() |
  | ![]() |
![]() | ![]() |
![]() | ![]() |
| 8 | ![]() | ![]() | ![]() |
![]() |   | ![]() | ![]() |
![]() | ![]() | ![]() |
![]() |   |
| 7 | ![]() | ![]() | ![]() |
![]() |   | ![]() |
![]() | ![]() | ![]() |
![]() |
  |   |
| 6 | ![]() | ![]() | ![]() |
![]() | ![]() |
![]() | ![]() | ![]() |
![]() |   |   |   |
| 5 | ![]() | ![]() | ![]() |
![]() | ![]() | ![]() |
![]() |
![]() | ![]() |
![]() | ![]() |
|
| 4 | ![]() | ![]() | ![]() |
![]() | ![]() | ![]() |
![]() |   |   |   |   |   |
| 3 | ![]() | ![]() | ![]() |
![]() | ![]() |
![]() | ![]() |
![]() | ![]() |
![]() | ![]() |
|
| 2 | ![]() | ![]() | ![]() |
![]() | ![]() |
![]() | ![]() |
![]() | ![]() |
![]() | ![]() |
|
| 1 | ![]() | ![]() | ![]() | ![]() |
![]() | ![]() | ![]() |
![]() | ![]() | ![]() |
![]() |
|
| 0 | ![]() | ![]() | ![]() | ![]() |
![]() | ![]() | ![]() |
![]() | ![]() | ![]() | ![]() |
|
| 0 | 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 |

Back to the main page...