# What's the formula for the number of possible answers to this puzzle?

I'm trying to find what the formula is for the number of possible variations to this puzzle. I know that there is only one answer (or 4, when taking into account the variations when the grid is flipped on either axis). Does a formula exist to describe the number of combinations/permutations here? One that could be applied if the rules of the puzzle were changed? (ie, if preceding/following numbers could be placed diagonally to each other, but still not vertically or horizontally, how many possible combinations/permutations would there be?

Correct me if I'm wrong, but the way I'm looking at it, the number of possible permutations when it comes to the original problem is 1, and the number of possible combinations is 4.

Perhaps I'm looking in completely the wrong direction?

• I don't think there is any magic formula, but you can reason out that essentially there is only one answer – Shailesh Sep 16 '18 at 6:51
• Totally! But if the rules of the puzzle were changed (neighbouring numbers can touch diagonally), how would you reason out the number of possible answers? – kmr Sep 16 '18 at 6:55
• If the rules were changed, you would change your reasoning to match the new rules. I don't see where you can expect much more than that. – Gerry Myerson Sep 16 '18 at 23:27
• Yes- if the rules were changed, there would be significantly more possible answers. My question is how many possible answers are there, dependent on the rules? – kmr Sep 17 '18 at 18:09

With the original rules, note that the two center squares must be $1$ and $8$. Each of the center squares is next to all the other squares but one, so if any other number is in the center it will have a neighbor that is one less or one more. We might as well put the $1$ on the left. Then $7$ must be the extreme left and $2$ must be the extreme right, so the center line is $$7182$$. Now $3$ has to go above or below the $1$ and it might as well go above. $6$ has to go above or below the $8$ and putting it above will have $4$ and $5$ next to each other. Then $5$ has to go above the $8$ and $4$ below the $1$, giving the solution $$\ \ 35\\7182\\ \ \ 46$$ We made two arbitrary binary choices and can show that changing the first leaves the second available, so there are four total arrangements, which consist of flipping it horizontally, vertically, or both.

If you weaken the restrictions there will be many more possibilities. One of the things that makes this a good puzzle is that you can get an answer without too much work but that you can't just randomly fill in numbers and hope to get there.

• Definitely- I was able to solve the puzzle easily, I'm just wondering if there's a way to describe the number of possibilities dependent on the rules of the game. – kmr Sep 17 '18 at 18:08
• I think you need to go through a similar process for any given set of rules. Depending on the rules there may be a simple way to count, or you may need to just write a program and count them all one by one. Without a clear statement of the range of rules I don't think we can say anything more. – Ross Millikan Sep 17 '18 at 18:49