Problem 9.4. An empty $3 \times 51$ table is drawn on the board. Masha wants to fill its cells with numbers, following these rules:

- each of the numbers $1, 2, 3, \ldots, 153$ must be present in the table;
- the number 1 must be in the bottom-left cell of the table;
- for any natural number $a \leqslant 152$, the numbers $a$ and $a+1$ must be in adjacent cells.

(a) (1 point) What is the largest number that can be in the cell adjacent to the number 1?

(b) (3 points) We will call a cell of the table good if the number 153 can be in it. How many good cells are there?
Answer: (a) 152. (b) 76.

Solution. Let's color the table in black and white so that the cell where the number 1 should be is black. The third rule in the condition means that consecutive numbers in the table are placed in a "snake" pattern, and the colors of their cells alternate, that is, all odd numbers, including 153, will also be in black cells.

|  |  |  |  |  |  |  |
| :--- | :--- | :--- | :--- | :--- | :--- | :--- |
|  |  |  |  |  |  |  |
| 1 |  |  |  |  |  |  |


|  |  |  |  |  |  |  |
| :--- | :--- | :--- | :--- | :--- | :--- | :--- |
|  |  |  |  |  |  |  |

(a) We already understand that the number 153 cannot be in a cell adjacent to 1. Let's prove that 152 can. For this, it is enough to provide a suitable arrangement of numbers:

| 153 | 150 | 149 | 146 | 145 | 142 | 141 |
| :---: | :---: | :---: | :---: | :---: | :---: | :---: |
| 152 | 151 | 148 | 147 | 144 | 143 | 140 |
| 1 | 2 | 3 | 4 | 5 | 6 | 7 |


| 65 | 62 | 61 | 58 | 57 | 54 | 53 |
| :--- | :--- | :--- | :--- | :--- | :--- | :--- |
| 64 | 63 | 60 | 59 | 56 | 55 | 52 |
| 45 | 46 | 47 | 48 | 49 | 50 | 51 |

(b) The number 153 can be in any black cell (in the above coloring), except for the one where the number 1 should be. Let's provide a series of corresponding examples. For the top row:

| 149 | 150 | 151 | 152 | 153 | 142 | 141 |
| :---: | :---: | :---: | :---: | :---: | :---: | :---: |
| 148 | 147 | 146 | 145 | 144 | 143 | 140 |
| 1 | 2 | 3 | 4 | 5 | 6 | 7 |


| 65 | 62 | 61 | 58 | 57 | 54 | 53 |
| :--- | :--- | :--- | :--- | :--- | :--- | :--- |
| 64 | 63 | 60 | 59 | 56 | 55 | 52 |
| 45 | 46 | 47 | 48 | 49 | 50 | 51 |

For the middle row:

| 147 | 146 | 145 | 144 | 143 | 142 | 141 |
| :---: | :---: | :---: | :---: | :---: | :---: | :---: |
| 148 | 149 | 150 | 151 | 152 | 153 | 140 |
| 1 | 2 | 3 | 4 | 5 | 6 | 7 |


| 65 | 62 | 61 | 58 | 57 | 54 | 53 |
| :--- | :--- | :--- | :--- | :--- | :--- | :--- |
| 64 | 63 | 60 | 59 | 56 | 55 | 52 |
| 45 | 46 | 47 | 48 | 49 | 50 | 51 |

For the bottom row:

| 3 | 4 | 5 | 6 | 7 | 8 | 9 |
| :---: | :---: | :---: | :---: | :---: | :---: | :---: |
| 2 | 149 | 148 | 147 | 146 | 145 | 142 |
| 1 | 150 | 151 | 152 | 153 | 144 | 143 |


| 47 | 48 | 49 | 50 | 51 | 52 | 53 |
| :--- | :--- | :--- | :--- | :--- | :--- | :--- |
| 66 | 65 | 62 | 61 | 58 | 57 | 54 |
| 67 | 64 | 63 | 60 | 59 | 56 | 55 |

If we exclude the cell with the number 1, then there are an equal number of black and white cells (for example, because any "snake" breaks down into pairs of adjacent cells of different colors). Therefore, there are 76 good cells.