Solution:
The answer is 5. In order for the given condition to be realized, it is necessary that one can make a path from the cell with the number 1 to the cell with the number 9 by moving successively from one cell to a cell adjacent to it. Let us color the chessboard in the usual way, so that the corner cells and the central one are black and the others are white. Moving from one cell to an adjacent cell means going from a black cell to a white one, or vice versa. It follows that, if 1 were in a white cell, then 2 would have to be in a black one, 3 in a white one, and so on. Therefore all the odd numbers from 1 to 9, which are 5, would have to be in white cells, while all the even numbers, which are 4, would have to be in black cells: but this is impossible, since there are 5 black cells and 4 white ones. Conversely, it is easy to construct spiral or snake-like paths so that any one of the odd numbers 1,3,5,7,9 appears in the central cell.