Ribamko A.v.

In the lower left corner of a $n \times n$ chessboard, there is a knight. It is known that the minimum number of moves it takes for the knight to reach the upper right corner is equal to the minimum number of moves it takes to reach the lower right corner. Find $n$.

#
Let $n$ be even. In this case, the lower left field has the same color as the upper right, while the lower right has a different color. After each move, the knight lands on a field of the opposite color. Therefore, any path from the lower left corner to the upper right consists of an even number of moves, and to the lower right - of an odd number.

Thus, their lengths are different.

: Let $n=4 k+1$. Then, by moving alternately along the fields of the two lower rows, the knight will reach the lower right corner in $2 k$ moves.

We will show that the path to the upper right corner is longer. Each move shifts the knight by a total of 3 fields horizontally and vertically. Even moving consistently to the right-up, the knight will move $6 k$ fields in $2 k$ moves. The total distance horizontally and vertically from the lower left corner to the upper right is $2 n-2 = 8 k > 6 k$. Therefore, the shortest path to the upper right field is longer.

Let $n=4 k-1$. Then the lower right field can be reached in $2 k$ moves as follows: the first move is one field to the right and two up, the second is one to the right and two down, and then, as in the previous case, move alternately along the fields of the two lower rows. It is impossible to get there in fewer moves.

Indeed, the knight needs to move $n-1=4 k-2$ cells to the right, and each move shifts it a maximum of two cells to the right. Therefore, the number of moves is at least $2 k-1$. But after $2 k-1$ moves, the knight will land on a field of the opposite color, and in our case, the lower right corner has the same color as the lower left, so at least one more move is needed, meaning the number of moves is at least $2 k$.

The maximum total shift to the right and up in $2 k$ moves remains $6 k$. The total distance horizontally and vertically from the lower left field to the upper right is $2 n-2 = 8 k-4$. For $k>2$, this is more than $6 k$. For $k=1 (n=3)$, it is easy to check all options and see that this case does not work. However, for $k=2 (n=7)$, both shortest paths consist of four moves, and this is also easy to verify.

## Answer

$n=7$.

Send a comment