The problem is a Markov chain, and we can attack it with linear algebra!
First, we can simplify the problem by exploiting the symmetry of both the knight's movement and the chessboard. Let's add the following rule:
- After every move, the knight is reflected across the horizontal, vertical, and diagonal axes of symmetry, until it rests in the upper-left triangle of $10$ squares.
In other words, the legal positions are 1a, 1b, 1c, 1d, 2b, 2c, 2d, 3c, 3d, and 4d. You can visualize these positions as occupying one of the $8$ triangles in this diagram:
Now, there are $11$ positions that the knight can occupy after a move: the $10$ positions just named, and $1$ position representing not-on-the-board. For $i,j\in[1,11]$, let $P_{i,j}$ be the probability of transitioning from $i$ to $j$. There are $11\times11=121$ probabilities to calculate, and I suspect that this part must be done by hand.
Now we have an $11\times11$ square matrix $P$. For all $n$, the matrix power $P^n$ is the transition matrix for $n$ moves! So, let's arbitrarily index the initial square as $i=1$ and the off-the-board position as $j=11$. Then the probability of leaving the board after $n$ moves is $(P^n)_{1,11}$, and the probability of staying on the board is:
$$1-(P^n)_{1,11}$$
That's as far as I can take you. You could express this formula more explicitly by calculating $P$ and then finding its Jordan normal form. Then you'll have a formula for the powers $P^n$, and you can pull out whatever matrix element you want. If you've seen the explicit formula for the Fibonacci numbers, it's the same principle, but with a larger matrix!
Edit: You've commented that if the knight is in the center of the board, then it can't exit the board in $1$ move. This is a useful obvservation. If we index positions 3c, 3d, and 4d as $i=8,9,10$, then it tells us that $P_{8,11}=P_{9,11}=P_{10,11}=0$. So you see, the matrix $P$ can represent pretty much everything we know about the problem.
Another example of reading information from $P$: You have a rule that if the knight leaves the board, it can't come back. This translates to the statement that $P_{11,11}=1$, and for all $j<11$, $P_{11,j}=0$. Between this paragraph and the previous paragraph, we already know $14$ matrix elements. There are just $107$ more to calculate...
Edit 2: Another example. You commented that from the initial position, only $2$ out of $8$ possible moves stay on the board. That tells us that $P_{1,11}=3/4$. The knight can stay on the board by moving to 2c or 3b. In my scheme, 3b gets reflected back to 2c. So if we index 2c as $j=6$, then $P_{1,6}=1/4$. For all other $j$ besides $6$ and $11$, we have $P_{1,j}=0$. That's another $11$ matrix elements calculated; $96$ to go...
A single $1,2$ move by a knight feels 'asymmetrical', and so the symmetry may at first sight be surprising from that perspective.
However, note that the expected number of moves that you re calculating is a function of all possible moves the knight could be making, and for every move the knight can make, there is a 'mirror' move that the knight can make as well. Or, more to the point: for every path a knight may take, you can mirror that path in the bottom-left-to-top-right diagonal.
For example, the first move from $(1,1)$ can go to $(2,3)$ or to $(3,2)$, which are the 'mirror' moves of each other when mirrored in the diagonal. Likewise, moving from $(2,3)$ to $(3,5)$ in the one case would be mirrored by going from $(3,2)$ to $(5,3)$ in the other case.
Indeed, every sequence of moves has a perfect mirror, and since the choice of moves is perfectly random, each of these mirror sequences is equally likely. So, from that perspective, the symmetry is in fact easily explained.
If you still don't see it, here is one more thing that you could do: Start the knight on $(1,1)$, and record for all possible subsequent moves, how many times a knight could have visited a square for each of the squares given all possible moves/paths. Thus, at the start, the $(1,1)$ square has a value of $1$, and all other squares a value of $0$. After he first move, the $(1,1)$, $(2,3)$, and $(3,2)$ squares all have a value of $1$. After two moves, $(1,1)$ will have a value of $3$ (you can go back to $(1,1)$ from both $(2,3)$ and $(3,2)$), and a bunch more squares will have a value of $1$ ... but I think you'll quickly find that the number remains symmetrical along the diagonal ... and the expected number of moves (which is function of all possible paths) is therefore symmetrical as well.
Best Answer
An exact solution can be acquired by computing $d_{x, y}(n)$ which is the number of distinct paths reaching $(x, y)$ for the first time after $n$ steps. The total number of paths $p_{x,y}(n)$ which contains $(x, y)$ after $n$ steps then has relationship:
$$p_{x, y}(n) = 8p_{x, y}(n-1) + d_{x, y}(n)$$
Using this we can express the expected number of distinct squares per path after $n$ steps, as counting the total number of distinct squares for each path and the total number of distinct paths crossing a square is equivalent when summing over all paths or all squares.
Then, saving some computation time we find by four-fold rotational symmetry that the expected number of distinct squares per path after $n$ steps is equivalent to:
$$1 + \frac{4}{8^{n}}\sum_{(x > 0, y \geq 0)} p_{x, y}(n)$$
How do we compute $d_{x, y}(n)$? We do it using matrices $M_{x, y}(n)$ which are initially zero everywhere except at $(0, 0)$ where they have value $1$. Then we apply a kernel convolution encoding the possible knight moves:
$$M'_{x, y}(n)=\begin{bmatrix}0&1&0&1&0\\ 1&0&0&0&1\\ 0&0&0&0&0\\ 1&0&0&0&1\\ 0&1&0&1&0\\\end{bmatrix}\star M_{x, y}(n-1)$$
Then $d_{x, y}(n)$ is the element at $(x, y)$ in $M'_{x, y}(n)$, and we set $(x, y)$ in the above matrix to zero to get $M_{x, y}(n)$ for future computation. Because we repeatedly set that coefficient to zero after each iteration it is that we count the number of distinct paths reaching $(x, y)$ for the first time, rather than all the paths that reach $(x, y)$ after $n$ steps. Unfortunately this does mean that for all possible $(x, y)$ we must compute these matrices a total of $n$ times.
I've implemented the above in Rust:
Giving the exact result:
$$\frac{455207943209697100946821497094086408107332219}{11150372599265311570767859136324180752990208} \approx 40.82446$$