TITLE: Moving on the surface of a cube
QUESTION [5 upvotes]: A $3 \times 3$ cube is composed of $27$, $1 \times 1$ cubes. Moving along the surface of the larger cube, how many ways are there to get from the closer top-left vertex, to the further bottom-right vertex?
Constraints:

You may only move along the surface of the cube
You may only move right, down, and forward
You may only move on the edges of the smaller cubes

REPLY [2 votes]: If you are interested in a general solution, for any $n x n$ cube, I will show you.
Odd $n$, where $n$ is the $k^{th}$ odd integer:
$\frac{(3n)!}{(n!)^{3}} - 3[2(\frac{(3n-3)!}{((n-1)!)^{3}}) + 6(\frac{(3n-4)!}{((n-1)!)^{2}(n-2)!}) + 6(\frac{(3n-5)!}{(n-1)!((n-2)!)^{2}}) + ... + (\frac{(n+1)!}{(k!)^{2}})(\frac{(n+1)!}{(n-1)!((n-k)!)^{2}})]$
Even $n$, where $n$ is the $k^{th}$ even integer:
$\frac{(3n)!}{(n!)^{3}} - 3[2(\frac{(3n-3)!}{((n-1)!)^{3}}) + 6(\frac{(3n-4)!}{((n-1)!)^{2}(n-2)!}) + 6(\frac{(3n-5)!}{(n-1)!((n-2)!)^{2}}) + ... + 2(\frac{(n+1)!}{(k)!(k+1)!})(\frac{(n+1)!}{(n-1)!(n-k)!(n-k-1)!})]$