The trouble is the count for n=6 may be so large that just incrementing a count from zero to the required size (and doing nothing else) might take months or years, and clearly that is an (unattainable) lower bound on any "try all cases" procedure.
But if not then my "fold and unfold" approach might come into its own for n=6, although some of the details would need generalizing and simplifying (even at the cost of making it sub-optimal).
edit: For n=6 (or any even n) the row and column "flip and adds" AKA merges don't leave an "unaffected apart from doubling" central row and column respectively, and that improves the array element equalization in these stages :
Original n=6 array:
After row flip-and-add :
After column flip-and-add:
After right diagonal flip-and-add :
So that leaves only the 6 distinct elements: c11, c22, c33, d12, d13, d23, in an array whose rows, columns, and main diagonals must sum to 8 * 21,
and it shouldn't take long to find all combinations of the latter with 4 <= c_ij <= 24 and 8 <= d_ij <= 48.
But if not then my "fold and unfold" approach might come into its own for n=6, although some of the details would need generalizing and simplifying (even at the cost of making it sub-optimal).
edit: For n=6 (or any even n) the row and column "flip and adds" AKA merges don't leave an "unaffected apart from doubling" central row and column respectively, and that improves the array element equalization in these stages :
Original n=6 array:
Code:
a11 a12 a13 a14 a15 a16 a21 a22 a23 a24 a25 a26 a31 a32 a33 a34 a35 a36 a41 a42 a43 a44 a45 a46 a51 a52 a53 a54 a55 a56 a61 a62 a63 a64 a65 a66
Code:
b11 b12 b13 b14 b15 b16 b21 b22 b23 b24 b25 b26 b31 b32 b33 b34 b35 b36 b31 b32 b33 b34 b35 b36 b21 b22 b23 b24 b25 b26 b11 b12 b13 b14 b15 b16
Code:
c11 c12 c13 c13 c12 c11 c21 c22 c23 c23 c22 c21 c31 c32 c33 c33 c32 c31 c31 c32 c33 c33 c32 c31 c21 c22 c23 c23 c22 c21 c11 c12 c13 c13 c12 c11
Code:
2 c11 d12 d13 d13 d12 d11 d12 2 c22 d23 d23 d22 d12 d13 d23 2 c33 d33 d23 d13 d13 d23 d33 2 c33 d23 d13 d12 d22 d23 d23 2 c22 d12 d11 d12 d13 d13 d12 2 c11
and it shouldn't take long to find all combinations of the latter with 4 <= c_ij <= 24 and 8 <= d_ij <= 48.
Comment