# 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.