# No ordinary magic square

Instead of placing every number from 1-9 in the square below such that each column, row and long diagonal has the same sum, do the opposite!

Place 1-9 in the squares below in a manner such that none of the columns, rows or long diagonals have the same sum: Edit: The question above seemed too easy for many of you. Lets take the next step. Please count or calculate the number of possible correct answers to the same question.

No ordinary magic square part 2. How many solutions are there?

• I think there must be many many solutions to this puzzle. I just put in the numbers 1-9 and swapped about 2 numbers. I think a much more interesting challenge might be to place some restrictions, or to see how many possibilities there are. I don't have the tools to do it myself, but I think that would pose a much more interesting challenge to the brilliant minds in this community. – Inazuma Jun 9 '16 at 9:17
• next puzzle should be how many combinations can this be done in? – Shane Rowatt Jun 9 '16 at 9:18
• @ShaneRowattgood idea – Greg Hastings Jun 9 '16 at 9:25
• @GregHastings You do not necessarily need to know the answer yourself. Tag it as open-ended, the right answer should be self-explanatory enough to be judged well by the community. – Inazuma Jun 9 '16 at 9:37
• No. When you tag as open-ended responders know they run the risk of not having a 'correct' answer. But it is also much more challenging because there is generally no distinct 'right answer'. However someone may be able to generate a code or come up with a permutations method etc. that can calculate the number of possible solutions, and if this can be proven to be correct, then you may want to tag it as the accepted answer. See puzzling.stackexchange.com/questions/8843/… for an example, perhaps. – Inazuma Jun 9 '16 at 9:41

The following is a solution

1 2 9
4 5 7
6 8 3

Reasoning

Sum of rows, then sum of columns, then diagonals.

129 = 12, 457 = 16, 683 = 17, 146 = 11, 258 = 15, 973 = 19, 153 = 9, 956 = 20

• You found a different answer than I did, but it checks out! Congratulations – Greg Hastings Jun 9 '16 at 9:08
• If I am sure someone is right, what is the reason for making me wait a certain number of minutes to accept an answer? – Greg Hastings Jun 9 '16 at 9:09
• @Greg Hastings I think the waiting period might be to stop spam, or perhaps to just give everyone an equal opportunity to post an answer. I'm not too sure. – Inazuma Jun 9 '16 at 9:11
• Shame on the anonymous down voter. Hmmm – Inazuma Jun 11 '16 at 4:08

1 2 3
4 5 6
7 8 9

Now the middle row and column both sum up to 15, so swap 6 and 8

1 2 3
4 5 8
7 6 9

Now both diagonals still sum up to 15, so swap 1 and 5.

5 2 3
4 1 8
7 6 9

Rows: 10,13,22, Columns: 16,9,20, Diagonals: 15,11

• correct. I know there are multiple solutions but have not attempted count how many. – Greg Hastings Jun 9 '16 at 9:23

169 On the top row, 258 On the second row, 374 On the third

• Correct. I know there are multiple solutions but have not attempted calculate how many. – Greg Hastings Jun 9 '16 at 9:23

One solution:

-------------- = 17
9 | 1 | 6 = 16
8 | 7 | 5 = 20
4 | 3 | 2 = 9
= | = | = 18
21 | 11 | 13

There are quite a few possible answers. Specifically:

There are 24960, out of a possible 362880 squares (ignoring the fact that you could consider two squares to be the same if rotated/flipped).

The first one, lexicographically sorted is

1 2 3
4 5 8
6 9 7

and the last one is

9 8 7
6 5 2
4 1 3

I arrived at the answer by writing a script in Python 3 that checks every possible option:

import itertools

matches = 0
for square in itertools.permutations(range(1, 10)):
sums = set()
# rows (sum consecutive groups of 3)
# columns (sum every third element, starting at a different position for each column)