Magic squares for everybody: for statesmen and pedestrians The book [1] is a book focused mainly in Franklin's magic squares but it has very interesting and suggestive sections and paragraphs that accompany this topic (summarizing is a jewel). I refer that Wikipedia has an article dedicated to Magic square.
I wondered in what different context we can to create magic squares. I did in the context of composite numbers, and primes in arithmetic progressions as I evoke below of the following recreational question.

Question. Please provide an arragement of numerical items filling the cells of a magic square (with for example irrational numbers, vectors, matrices, paths, loops, logic propositions, differential forms,...) or abstract objects (sets, subgroups, manifolds,...) into rows and colums in such way that the "magic sum" is computed according an operation that you propose (product, sum, tensor product, integration, cardinality, order of a subgroup, Euler's characteristic, indexes of field extensions,...) with the purpose to create a magic square in the a different context, maybe the context of calculus, abstract algebra, real analysis, geometry, topology, logic,... Many thanks.

For example one can to exploit the article from Wikipedia Primes in arithmetic progression AP with $k=16$ disposing these primes according the method explained in pages 148-150 and plate/Fig. C.6 of [1] to create a $4\times 4$ magic square. Also one can to use the fact that $49!+k$ with $2\leq k\leq 25$ are composite integers and the procedure in page 37 of the nice book (in Spanish) [2] to create a $5\times 5$ magic square.
References:
[1] Paul C. Pasles, Benjamin Franklin's Numbers, Princeton University Press (2008).
[2] André Jouette, El secreto de los números, Ediciones Robinbook (2000).
 A: Many recreational math books wax poetic about the extra sums/symmetries in a fourth-order pandiagonal magic square. Actually fifth order comes across to me as even more elegant. And you don't even need numbers to demonstrate it.

The above square consists of elements in which each side of a regular pentagon is paired with one of its diagonals, going through all 25 such pairs. If you sum any row, column or diagonal by superposing the figures so that the vertices match up, you get the complete figure shown on the right. That includes the broken diagonals obtained by successively wrapping the right column to the left, the bottom row to the top, etc.
But wait, there's more! Select any cell and combine it with the adjacent cells in its row or column, wrapping where necessary. The resulting "quincunx" adds up to the magic sum. The same is true of the following patterns, which again include any necessary wrapping:

*

*Any cell and the four nonadjacent ones in its row and column


*Any cell and the four adjacent ones along the diagonals


*Any cell and the four nonadjacent ones along the diagonals; one of these is the four corners of the array plus the center
This gives a total of $120$ magic sums in a pandiagonal $5×5$ magic square, isomorphous with the $120$ permutations of five objects.
