TITLE: Knight tour prime (conjecture)
QUESTION [9 upvotes]: Hello,
I have the following conjecture:
Write all numbers from $1$ to $n^2$ over an $n\times n$ board as usually. There not exists $n$ such that we can find a hamiltonian path on primes numbers with a knight.
Andres Sanchez Perez (Ecole Polytechnique, Paris, France) verified this conjecture for $3\leq n \leq 100$.
Any comments or reference will be appreciated.

REPLY [4 votes]: An argument for even $n$: Suppose that $n\geq16$ is even, and consider the first two rows, consisting of $1,\ldots n$ and $n+1,\ldots,2n$, respectively. Since $3$, $7$, and $11$ are primes, in order for them to be reachable, at least $3$ of $n+1$, $n+5$, $n+9$, and $n+13$ must be primes. Modulo $3$ these are $n+1$, $n+2$, $n$, and $n+1$, so there is at least one composite number among these $4$ numbers. Hence one has to choose one of the following two triples: $(n+1,n+5,n+13)$ or $(n+1,n+9,n+13)$. In the first case, it leaves each of $7$ and $11$ reachable from only one square in the second row ($n+5$ and $n+13$), and similarly in the second case, each of $3$ and $7$ would be reachable from only one second-row square ($n+1$ and $n+9$). In any case, this means that each of the remaining primes in the first row must be reachable from two second-row squares, in order for a Hamiltonian path to exist. Now we look at the primes $5$ and $13$, which are in the first row, and conclude that $n+3$, $n+7$, $n+11$, and $n+15$ must all be primes. Modulo $3$, these are $n$, $n+1$, $n+2$, and $n$, making it clear that there is at least one composite number among them.
A different argument for even $n$, assuming that $2$ is not a prime:
Color the odd squares white, and the even squares black, as in Eric's answer. Since $n$ is even, this would mean simply that the odd columns are white, and the even columns are black. We do not want the knight falling on a black square, so we can remove the black columns, and assume that the knight moves diagonally. If we colour this board in checkerboard pattern, then a knight started on a white square must stay on white squares, and a knight started on a black square must stay on black squares. So essentially half of the odd numbers are forbidden, no matter where the knight's initial position is. Now, we note that $3$ and $5$ are in different groups (if $n\geq6$), so at least one of them is unreachable.
When we relax the assumption that $2$ is not a prime, there is a way to switch colour for the knight by going through $2$. But this is the only way, and it requires $2n+1$ and $2n+3$ be both primes.