Consider paths in $\mathbb{Z}^3$ between two points, where the steps avaible are in the form of $(\pm 1, 0, 0)$,$(0,\pm 1,0)$,$(0,0, \pm 1)$. How many paths of $10$ steps there is between the points $(2,1,-1)$ and $(6,4,2)$ that don't pass through the point $(5,2,1)$?
Working with paths in $\mathbb{Z}^2$ there is a general formula where the solution is: $ \binom n {a_1,...,a_k} $, where $n=a_1+...+a_k.$
Is there any formula or simple way of calculating steps in $\mathbb{Z}^3$?
The general solution for the number of paths in $\mathbb Z^m$ is given by the multinomial coefficient
$$\binom {n}{a_1+a_2+a_3+\cdots+a_m}$$ where $n=a_1+a_2+a_3+\cdots+a_m$, and $a_i$ is the number of steps in the $i^{\text{th}}$ direction. This assumes no backtracking allowed. See additional notes below.
Let $A=(2,1,-1), B=(6,4,2), C=(5,2,1)$.
This gives $AB=(4,3,3) \; (10\text{ steps}),\; AC=(3,1,2) \;(6\text{ steps}),\; CB=(1,2,1)\; (4\text{ steps})$.
Number of ways to get from $A$ to $B$:
$$\binom {10}{4,3,3}=\frac{(10)!}{4!3!3!}=4200$$
Number of ways to get from $A$ to $B$ passing through $C$:
$$\binom 6{3,1,2}\cdot \binom 4{1,2,1}=\frac {6!}{3!1!2!}\cdot \frac {4!}{1!2!1!}=6!=720$$ Therefore, number of ways to get from $A$ to $B$ without passing through $C$ is $$4200-720=\color{red}{3480}$$
Additional Notes
When $m=2$ this reduces to a $2$D grid walk, and in particular if $a_1=a_2=N$, i.e. $n=2N$, then the number of paths reduces to the central binomial coefficient $$\frac {(2N)!}{N!N!}=\binom {2N}N$$
Similarly, for $m=2$, and $a_1=a_2=a_3=N$, this reduces to a walk on a cubic grid, and total number of paths given by $$\frac {(3N)!}{N!N!N!}=\binom {3N}{N,N,N}$$