### Some examples for calculating Grundy number

Here are some examples to show how to calculate Grundy numbers.

Example 5.3   We show the method to find the value of in Fig. 5.15 that is a table of Grundy numbers of the chocolate game with the inequality .
If we are to find the value that is in the green rectangle, by Lemma 5.1 we have only to find the smallest number that does not belong to

By Definition 5.2 can be separated into three parts
, and .
The numbers of are in blue rectangles.

 (5.1)

The numbers of are in red or white rectangles.

 (5.2)

 (5.3)

 (5.4)

The numbers of are in yellow or white rectangles.

 (5.5)

 (5.6)

By (5.1) and (5.2) we have

 (5.7)

By (5.3) and (5.4) we have

 (5.8)

By (5.5) and (5.6)

 (5.9)

By (5.4), (5.7), (5.8) and (5.9) we have , and is the smallest number that does not belong to . Therefore .

Remark 5.1   In Fig. 5.15 the positions of and have important role. These Grundy numbers are in purple rectangles.
is the last term in the arithmetic sequence of common difference of 3 in the row when , and is the last term in the arithmetic sequence of common difference of 3 in the column when . Since these numbers are the last term of arithmetic sequence of common difference of 3, the calculation of is easy by the fact that is under Grundy number and it is on the right side of Grundy number .

Example 5.4   We show the method to find the value of in Fig. 5.16 that is a table of Grundy numbers of the chocolate game with the inequality .
To find the value of we have only to find the smallest number that does not belong to .

By Definition 5.2

 (5.10)

 (5.11)

 (5.12)

 (5.13)

 (5.14)

By (5.10) and (5.11) we have .
By (5.13) and (5.14) all the numbers in are bigger than .
By (5.12) we have Note that the list {19,21,23,25,27,29,31} does not contain . Therefore we have . A very important fact is that the numbers in the list and the number have opposite parity. This fact play an important role when we prove predictions generally.

Example 5.5   We show the method to find the value of in Fig. 5.17 that is a table of Grundy numbers of the chocolate game with the inequality .
To find the value of we have only to find the smallest number that does not belong to

Remark 5.2   Note that is in the midst of the the sequence in the column for , and this condition make this example different from Example 5.3 and Example 5.4.

 (5.15)

 (5.16)

Clearly

 (5.17)

 (5.18)

 (5.19)

 (5.20)

By (5.15) and (5.17) we have

 (5.21)

By (5.16), (5.18), (5.19) and (5.20) The lists , and do not contain , and hence we have .

Example 5.6   We show the method to find the value of in Fig. 5.18 that is a table of Grundy numbers of the chocolate game with the inequality .
To find the value of we have only to find the smallest number that does not belong to

 (5.22)

 (5.23)

Clearly

 (5.24)

 (5.25)

By using Prediction 5.3 for and

 (5.26)

 (5.27)

By (5.22) and (5.24) we have

 (5.28)

By (5.26) and (5.27) we have

 (5.29)

By using Prediction 5.3 for and
we know that the sequence of (5.29) starts as an arithmetic sequence with common difference of whose length is , and hence the last term of this arithmetic sequence is . The next term in (5.29) is , and after that we have an arithmetic sequence with common difference of up until it reaches . Therefore by (5.23), (5.28) and (5.29) we have . It is clear that there is no in , and hence we have .