King on a $15 \times 15$ chessboard A king is placed in the center tile of a $15 \times 15$ chessboard. He can move in the usual ways, 1 move in any direction. In how many ways can he return to his original position if he can make a total of 6 moves in all.
I know that the whole "$15 \times 15$ board" is to throw one off, since he is essentially limited to an $7 \times 7$ board, due to number-of-moves restriction. I also know that the first step has nine possibilities, but from the second step onwards it seems like a mathematical impossibility to consider all moves possible. Could someone please help?
 A: It is the coefficient $x^0y^0$ in the generating function
\begin{eqnarray*}
\left( \frac{1}{xy}+\frac{1}{x} +\frac{1}{y}+\frac{x}{y}+\frac{y}{x}+x+y+xy \right)^6.
\end{eqnarray*}
A: The first step is to list the combinations of moves that can return to start.  One is three up and three down.  There are ${6 \choose 3}=15$ ways to put those in order.  There are other combinations with two types of moves, each of which gives $15$ possibilities.  There are also some with three types of moves.
A: Hint:
You know the first step is to one of the eight neighboring squares (red), and the last step is from one of those squares.  (Call it the "central ring.")  So the problem reduces to calculating the number of 4-step paths that lead from a point on the central ring back to a point on the central ring.  There are only two categories of cases:  The starting point is on an edge or on a corner.

You should be able to count these cases through exhaustive enumeration.
Then use this with the total number of corners and of edge squares, totaling them up.
A: Instead of thinking of the king moving on a chessboard, we can instead translate the problem into one of walks in a graph. Specifically, consider squares of the board the vertices of the graph, and place an edge between them if they differ by a King move. 
Now, the problem becomes "How many closed walks of length 6 are there on this graph." (or depending on your interpretation, length up to 6) Fortunately, this problem has a known solution using adjacency matrices. 
I'll let you read up on it by yourself, but essentially, you compute the 6th power of the adjacency matrix of this graph, then look at the entry $(i,i)$, where $i$ is the index of the vertex corresponding to where the king is initially placed. 
This can be somewhat cumbersome to compute by hand (I'll let other answers deal with that), but it has the advantage of giving the correct answer wherever the king is initially placed---most other answers break down if the king is on an edge, corner, or one step away from the center, etc. It also generalizes to an arbitrary number of steps.
