4 x 4 Magic Square solutions

7040?

Thanks.

I was looking for other mechanisms of making the 880, and came across a set of 384 "pan-diagonal" magic squares with extra constraints where all of the "broken diagonals" also add up to the sum. They are have extra symmetries where you can rotate them by one column or row (e.g. cols 0123 become cols 3012) and remain pan-magic squares.

This site says you can construct them all from three basic squares:

And wikipedia sort of says it too:

A pandiagonal magic square remains pandiagonally magic not only under rotation or reflection, but also if a row or column is moved from one side of the square to the opposite side. As such, an n×n pandiagonal magic square can be regarded as having 8*n^2 orientations.

With n=4, 8*n^2=128, you get 128 transforms on each of the 3 unique basic pan-diagonal squares to get to the 384 total "most perfect magic squares".

From the set of 880, solution #150 is a "most perfect magic square" with the broken diagonals, the sub-squres

Solution #150 [9 sec]:
 1 12  7 14 
 6 15  4  9 
16  5 10  3 
11  2 13  8 

All these patterns of sums on the #150 solution (and the special 384 of the 880 unique ones) will add up to magic constant "34":