Solution
The Semi-Magic Nine
Show the problem again
Fill a 3×3 grid with the numbers 1 through 9, each used exactly once, so that all three rows and all three columns sum to 15. The diagonals are not required to sum to anything. Rotations and reflections count as different fillings. How many fillings are there? Give an integer.
Worked solution
Each row is a triple from 1..9 summing to 15, and the three rows must partition {1,...,9}. Only two such partitions exist: {1,5,9}, {2,6,7}, {3,4,8} and {1,6,8}, {2,4,9}, {3,5,7}. In a valid grid the rows form one of these partitions and the columns form the other (each column is also a triple summing to 15, and a column must take one number from each row, which rules out the rows' own partition). Every triple of one partition meets every triple of the other in exactly one number. So choose which partition supplies the rows (2 ways), the order of the rows (3! = 6) and the order of the first row (3! = 6); then each column is the triple of the other partition through its top entry, and its meeting points with rows 2 and 3 are forced. That gives 2 × 6 × 6 = **72** grids, matching a direct enumeration of all 9! fillings. Only 8 of these 72 also have both diagonals summing to 15, which are the true magic squares.
Source: Variation on the 3×3 magic square, relaxing the diagonal condition; counting formulation written for AxiomIQ.