I'm sorry if this is the wrong section to post this in, but I'm not quite sure what category of math this problem falls into. I want to find out if there's a way to calculate (or just find) a path through a 15x15 grid which covers every square, and comes back to the square in which it started. In text, this is a bit confusing, but here's an image that might explain it better.
This is a solution to a 10x10 grid. Note how the path marked by the arrows passes through every square, and reaches the beginning again. There can't be any diagonal moves, only up, down, left, and right. The path also cannot cross itself. Is there any way to achieve this result on a 15x15 grid? I wouldn't be surprised if this is impossible, but if it is I'd really be interested in the mathematical reason why that might be. I've sat down and tried to create a working pattern just by guessing for around an hour, and couldn't find any good solutions. I'd really appreciate your help, thanks!
This is a solution to a 10x10 grid. Note how the path marked by the arrows passes through every square, and reaches the beginning again. There can't be any diagonal moves, only up, down, left, and right. The path also cannot cross itself. Is there any way to achieve this result on a 15x15 grid? I wouldn't be surprised if this is impossible, but if it is I'd really be interested in the mathematical reason why that might be. I've sat down and tried to create a working pattern just by guessing for around an hour, and couldn't find any good solutions. I'd really appreciate your help, thanks!