How can a compact complete $4\times4$ magic square be constructed, with 4 given values in the top row?

66 Views Asked by At

An $n\times n$ magic square with magic total $T$ is termed compact if every $2\times2$ block has the sum $4T/n$. By a block is meant those elements where two neighbouring rows (or the top and bottom rows) cross two neighbouring columns (or the left and right columns).

An $n\times n$ magic square with magic total $T$ is termed complete if $n$ is even, and every antipodal pair of elements (i.e. pair of elements $n/2$ diagonal steps apart) has the sum $2T/n$.

These terms are defined here.

This question arose from a discussion of this question by Peđa Terzić.

1

There are 1 best solutions below

0
On

The above criteria leave one degree of freedom, so it is possible to finesse the magic square even more, and fix one more value, for example, the value in the element just below the top left-most. The square is: \begin{array}{|c|c|c|c|} \hline a&b&c&d\\ \hline e&T-a-b-e&a+e-c&T-a-d-e\\ \hline T/2-c&T/2-d&T/2-a&T/2-b\\ \hline T/2+c-a-e&a+d+e-T/2&T/2-e&a+b+e-T/2\\ \hline \end{array}

If $T$ is odd, then in each of the 8 antipodal pairs, the sum is not an integer, so at most 8 of the entries can be integers.

The formulae for the second row's elements were obtained using the compactness criterion, then for the bottom half using completeness. It is easy enough to verify that the square is compact and complete.

Sage implementation of the algorithm.