I've been trying to find a solution to this problem for a few days now and I'm hoping someone here may be able to help.
I'm trying to find the total number of paths in a MxN grid with the following rules/restrictions.
Path must start from (0,0) and end at (M,N).
Each step can only be E (1,0), NE (1,1) or SE (1, -1)
Once the path reaches height N it may only travel East
Pretty much the end location of a Delannoy path and the direction restrictions of a Motzkin path.
Heres a table of values if it helps. I noticed a few patterns, a couple are obvious so I won't list them. But theres also the N=1 column can be calculated with f(x) = $2^M-1$ And starting from N=1, M=3 is this pattern A027379 along the diagonal.
Table of (M,N) values ( To clarify the table values are the number of unique paths in a grid of size (M,N) following the restrictions listed above )
EDIT 1:
I've created an image to better explain everything, it shows all unique paths for a few different M,N cases. Unique paths illustration
Also I've made a little progress. I think this can be broken into two sub problems.
- A) Unique paths excluding SE moves
- B) Unique paths with at least one SE move
And then the total paths is of course A+B
Because we have to move North East exactly N times and there are M possible places we know that A = $\binom{M}{N}$
I'm not sure how to find B though. I know that if we look at the unique paths we get without any SE moves we find that the SE moves are duplicates of paths where two consecutive E moves happen and where 0 < Y < N. The E, E moves just become SE, NE
EDIT 2 In case it helps here is a table of the number of paths with SE moves for each case in the previous table. SE paths per grid size
EDIT 3 I’ve been unable to solve this after almost six days. If anyone knows there is no closed solution to this problem and can prove or explain why, that’d be much appreciated so I can give up on it.