An associative magic square remains associative when two same sided rows (or columns) are interchanged along with corresponding other sided rows (or columns). For an even square, since there are n/2 same sided rows (or columns), there are n(n - 2)/8 pairs of such rows (or columns) that can be interchanged. Thus, 2n(n-2)/8 × 2n(n-2)/8 = 2n(n-2)/4 equivalent magic squares can be obtained by combining such interchanges. For odd square, since there are (n - 1)/2 same sided rows or columns, there are (n - 1)(n - 3)/8 pairs of such rows or columns that can be interchanged. Thus, there are 2(n - 1)(n - 3)/8 × 2(n - 1)(n - 3)/8 = 2(n - 1)(n - 3)/4 equivalent magic squares obtained by combining such interchanges. Interchanging all the same sided rows flips each quadrants of the square vertically, while interchanging all the same sided columns flips each quadrant of the square horizontally. In the example below, the original square is on the left, whose rows 1 and 2 are interchanged with each other, along with rows 3 and 4, to obtain the transformed square on the right.
An associative magic square remains associative .when two same sided rows (or columns) are interchanged along with corresponding other sided rows (or columns). For an even square, since there are n/2 same sided rows (or columns), there are n(n - 2)/8 pairs of such rows (or columns) that can be interchanged. Thus, 2n(n-2)/8 × 2n(n-2)/8 = 2n(n-2)/4 equivalent magic squares can be obtained by combining such interchanges. For odd square, since there are (n - 1)/2 same sided rows or columns, there are (n - 1)(n - 3)/8 pairs of such rows or columns that can be interchanged. Thus, there are 2(n - 1)(n - 3)/8 × 2(n - 1)(n - 3)/8 = 2(n - 1)(n - 3)/4 equivalent magic squares obtained by combining such interchanges Interchanging all the same sided rows flips each quadrants of the square vertically, while interchanging all the same sided columns flips each quadrant of the square horizontally. In the example below, the original square is on the left, whose rows 1 and 2 are interchanged with each other, along with rows 3 and 4, to obtain the transformed square on the right.