This is a problem that I set myself when I was at school. Find a formula $f(N,M)$ for the number of paths in an $N\times M$ grid starting at the bottom left, ending at the top right and going through every square once and only once.
I never was able to find a formula for this.
Is there a solution?