A knight stands on the top-left square of a 2n×2n chessboard. In one move the knight goes two squares in one direction and one square in the perpendicular direction, so its row and column change by (±1,±2) or (±2,±1). A move that leaves the board is not allowed.
The corner squares are the four squares at the corners of the board: top-left, top-right, bottom-left, and bottom-right.
Count the ways to make at most k moves and finish on a corner square. Two ways are different if they use a different number of moves, or if they visit a different sequence of squares. The knight already stands on the top-left corner at the start, so making no move at all counts as one way.
Stated another way, for every t with 0≤t≤k, count the paths that start on the top-left square, make exactly t moves, and end on a corner square, then add all of those counts. A path may revisit a square, and it may enter a corner square and leave it again.