Problem: In $\mathbb{Z}^3$ starting from $(0,0,0)$ we try to reach $(p,q,r)$ with a sequence of moves. In each step we make a move from a point to another point under following conditions:
- You can only move to a point with integer coordinates.
- You can only move to a point $(a,b,c)$ such that $0\leq a \leq p, \ 0 \leq b \leq q,\ 0 \leq c \leq r$. i.e. you have to stay in the "$p,q,r$" prism.
- You can't move to a point that you have already moved.
- From a point $(a,b,c)$ you can move to one of the points $(a+1,b,c),(a-1,b,c),(a,b+1,c),(a,b-1,c),(a,b,c+1),(a,b,c-1)$ which satisfy above conditions i.e. you can move 1 unit step in one of the three coordinates.
We denote $f(p,q,r)$ as different ways of reaching $(p,q,r)$ from $(0,0,0)$ as described above. Is there a closed formula or a recurrence relation for $f(p,q,r)$?
Ideas:
- I know that if we change the 4th restriction with "you can only move in the positive directions" then the answer is $\frac{(p+q+r)!}{p!q!r!}$. So $f(p,q,r)$ is larger than this number.
- Second condition makes it very difficult to use induction or recurrence relation.
- Working on two dimensional version of the problem doesn't make it simple.
I believe this problem must have appeared somewhere. Any references, hints are welcomed. Thank you for reading the entire entry.