## A parametrization of 8 × 8 magic squares of squares through octonionic multiplication

## Ísabel Pirsic

In 1771 Euler posed what he called a 'problema curiosum' [3]: to find a 4 × 4 magic square of squares, i.e., an integer matrix M such that MM /latticetop = M M /latticetop = c ∗ I, c ∈ Z , where also the sums of the squares of the diagonal entries should add up to c .

He gave explicit solutions, e.g.,

| 68   | - 29   | 41   |   - 37 |
|------|--------|------|--------|
| - 17 | 31     | 79   |     32 |
| 59   | 28     | - 23 |     61 |
| - 11 | - 77   | 8    |     49 |

but also the following interesting parametrisation:

| +a p+b q+ +c r+d s     | +a r - b s - c p+d q   | - a s - b r +c q+d p   | +a q - b p +c s - d r   |
|------------------------|------------------------|------------------------|-------------------------|
| - a q+b p+ +c s - d r  | +a s+b r +c q+d p      | +a r - b s +c p - d q  | +a p+b q - c r - d s    |
| +a r+b s - - c p - d q | - a p+b q - c r+d s    | +a q+b p +c s+d r      | +a s - b r - c q+d p    |
| - a s+b r - - c q+d p  | - a q - b p +c s+d r   | - a p+b q +c r - d s   | +a r+b s +c p+d q       |

where, to fulfill the diagonal conditions, two equations have to be satisfied, namely

$$\ddots \mu p r + q s \ = \ 0, \quad \frac { a } { c } = \frac { - d ( p q + r s ) - b ( p s + q r ) } { b ( p q + r s ) + d ( p s + q r ) }.$$

It is not known exactly, how Euler arrived at the solution, though we can take some guesses. For instance, the visualization presented in Figure 1 hints at a strong connection to Latin squares, famously another of Euler's research objects [2]. - The figure is to be read like this: For each 2 × 2 subsquare, the colors signify the first factor of a term like ap , the place inside the subsquare the second and the white squares negated terms.

Only in the early 1900s, Hurwitz gave a deeper explanation for Euler's matrix. In the last chapter of his 'Vorlesungen über die Zahlentheorie der Quaternionen' [4], he effectively proves that SO (4 , R ) can be modelled by combined

Figure 1: The quaternionic magic square of squares

![image](https://ac.marcodsn.me/arxiv-markdown-images/1908.00838v2-figure-ec9c3d13-fbda-49ee-83de-e893e8280c4a.jpg)

left and right multiplication of quaternions, i.e., for any γ ∈ SO (4) there exist quaternions q L , q R of norm 1, such that

$$\gamma \left ( ( a, b, c, d ) \right ) = ( p, q, r, s ) \quad \Longleftrightarrow \quad q _ { L } * ( a + b i + c j + d k ) * q _ { R } = p + q i + r j + s k,$$

where i, j, k are the quaternionic basis elements. (We will identify 4-vectors and quaternions.) Therefore, if we initially have a orthonormal basis { e 1 , e 2 , e 3 , e 4 } = { 1 , i, j, k } , transformation by multiplication to

$$A * e _ { i } * P = ( a + b i + c j + d k ) * e _ { i } * ( p + q i + r j + s k ),$$

with not necessarily unit quaternions A,P will give an at least orthogonal basis again. And this is exactly what happens in Euler's matrix, save some sign changes and column permutation; the rows are given by the components of A ∗ e i ∗ P . The column permutation is necessary to make the diagonal conditions easier to attain, sign changes are probably just for aesthetic reasons.

Euler did not know yet about quaternions, but he had found the four-squaresidentity

$$\begin{matrix} ( a _ { 1 } ^ { 2 } + a _ { 2 } ^ { 2 } + a _ { 3 } ^ { 2 } + a _ { 4 } ^ { 2 } ) ( b _ { 1 } ^ { 2 } + b _ { 2 } ^ { 2 } + b _ { 3 } ^ { 2 } + b _ { 4 } ^ { 2 } ) = \\ ( a _ { 1 } b _ { 1 } - a _ { 2 } b _ { 2 } - a _ { 3 } b _ { 3 } - a _ { 4 } b _ { 4 } ) ^ { 2 } + ( a _ { 1 } b _ { 2 } + a _ { 2 } b _ { 1 } + a _ { 3 } b _ { 4 } - a _ { 4 } b _ { 3 } ) ^ { 2 } + \\ ( a _ { 1 } b _ { 3 } - a _ { 2 } b _ { 4 } + a _ { 3 } b _ { 1 } + a _ { 4 } b _ { 2 } ) ^ { 2 } + ( a _ { 1 } b _ { 4 } + a _ { 2 } b _ { 3 } - a _ { 3 } b _ { 2 } + a _ { 4 } b _ { 1 } ) ^ { 2 } \end{matrix}$$

which secretly is also founded on quaternionic multiplication. It may indeed be seen as the multiplicativity of the quaternionic norm, i.e., N A N B ( ) ( ) = N AB ( ). This is relevant in the magic square context, since the norm of the rows is thus constant and equal to

$$N ( A e _ { i } P ) = N ( A ) N ( e _ { i } ) N ( P ) = N ( A ) N ( P ).$$

Now arose the question, if a similar thing can be done for the octonions, the infamously non-associative Cayley-Dickson extension of the quaternions. There, it is known (see, e.g., [1]) that SO (8) is generated by at most seven multiplications, either all left or all right, but conversely any single multiplication with a unit octonion is also associated to a transformation in SO (8).

So, in order to obtain a magic square of size 8 with reasonably small norm, the same approach as shown by Hurwitz may be made, i.e., to build a matrix from the components of A ∗ ( e i ∗ P , ) where e i runs through the octonionic basis elements. (Multiplying with just one octonion would not give a 'magic' matrix, i.e., where all entries are distinct; so two is the minimum. Similarly, performing two multiplications on the same side does not produce enough distinct elements.) - To give this matrix in detail in text form is not particularly enlightning, we will instead present its visualization analogous to the 4 × 4 case (the grey fields are just a way to complete the square) in Figure 2.

Some properties are apparent in this visualization, e.g., the various Sudokulike combinatorial conditions that are fulfilled in the rows and columns of subsquares, and also the quadrants, a central symmetry regarding subsquares, as

Figure 2: The octonionic semimagic square of squares

![image](https://ac.marcodsn.me/arxiv-markdown-images/1908.00838v2-figure-57495c02-bcee-4677-8837-59b488f45aae.jpg)

well as, on a finer scale, the white squares representing the negative terms. Intriguing is also the fact that offside the diagonal all choices of 3 elements from 8 are present.

This matrix is then indeed found to be row-orthogonal, as can also be verified using a computer algebra system; leading to the only 'theorem' in this note:

## Theorem 1 Let

$$A & = ( a e _ { 1 } + b e _ { 2 } + c e _ { 3 } + d e _ { 4 } + e e _ { 5 } + f e _ { 6 } + g e _ { 7 } + h e _ { 8 } ), \\ P & = ( p e _ { 1 } + q e _ { 2 } + r e _ { 3 } + s e _ { 4 } + t e _ { 5 } + u e _ { 6 } + v e _ { 7 } + w e _ { 8 } ), \\ A, P & \in \mathbb { O } [ a, b, \dots, h, \, p, q, \dots, w ]$$

be symbolic octonions, (i.e., a, b, . . . , h, p, q, . . . , w are variables, and e 1 = 1 , e i are orthogonal basis elements of O ) and let M ∈ R [ a, . . . , h, p, . . . , w ] 8 × 8 be given by the i -th row vector defined as the components of A ( e i P ) .

Then the matrix M constitutes a symbolic semi-magic square of squares with entries in Z [ a, . . . , h, p, . . . , w ] , with orthogonal rows and constant N A N P ( ) ( ) .

Consequently, supposing the matrix is evaluated at some A , P 0 0 ∈ Q 8 , such that all entries are distinct integers, this integer matrix constitutes an (integral) semi-magic square of squares with orthogonal rows and constant N A ( 0 ) N P ( 0 ) .

Proof The assertions on M follow from the fact that multiplication with unit octonions models SO (8) (see [1]), hence right multiplication with P and subsequent left multiplication with A preserves the initial orthogonality, while multiplying all lengths equally. Also, all choices of orthogonal basis elements act as a permutation on each other, up to sign change, so that the coefficients of the matrix entries are all ± 1. That all entries are different can be verified by calculation, e.g., using Sage [5]. Figure 2 also visualizes this in that no two 3 × 3-subsquares have the same pattern combination of colors and white squares. The rest of the assertions then follows. glyph[square]

- Having attained a parametrisation the next step is to find numbers such that the entries are indeed different and the constant is low. By plugging in concrete values for the A,P , e.g., this matrix with constant 9476 could be found:

|   43 |   16 |   -19 |   8 |   -22 |   47 |   38 |   -53 |
|------|------|-------|-----|-------|------|------|-------|
|  -30 |   11 |    30 |   5 |    25 |  -32 |   75 |   -16 |
|    9 |   -4 |    -7 | -52 |   -46 |  -57 |   -6 |   -35 |
|   -8 |  -67 |    48 |  21 |    -5 |   10 |  -17 |   -42 |
|   54 |  -11 |    14 |  49 |   -31 |  -36 |   17 |    36 |
|   44 |   41 |    60 | -21 |    33 |   -2 |  -25 |   -10 |
|    7 |  -26 |    29 | -54 |   -24 |   37 |   32 |    45 |
|  -41 |   46 |    35 |  22 |   -60 |   15 |  -12 |     1 |

which only lacks the diagonal properties required for a fully magic matrix; this type is called semi-magic.

The diagonal properties in Euler's matrix arose from choosing such a permutation of rows that in the diagonal all terms were present. Then calculating

the sum of squares of the diagonal elements and subtracting the magic constant leads very naturally to the side conditions. - This does not work with the 8 × 8 matrix, at least not in an obvious straightforward manner, so that for now we cannot ascertain whether or not a fully magic matrix exists. A small scale randomized computer search using parameters within the range -32 to 32 did not produce any results.

It is not difficult to find at least parameters such that not only all entries but also all their squares (or absolute values) are distinct, one of low constant 43617 is given by

$$A = ( - 2, - 3, 7, - 1, 2, - 1 1, 2, - 5 ), \ \ P = ( - 7, 4, - 4, - 9, 1, 2, - 5, 3 ).$$

When presenting the matrix in terms of the parameters, it is dependent on the specific implementation of the algebra. We chose the Cayley-Dickson extension of the quaternion algebra as given by the computer algebra system Sage [5]. (The according scripts are available from the author by request.)

The parameters for the 9476 matrix exhibit an interesting detail, in that one of them has half integers for coordinates:

$$A = ( 8, - 2, - 4, 8, - 4, - 1, - 5, - 4 ), \ \ P = \frac { 1 } { 2 } ( 5, 7, - 1, - 3, - 7, 1, 7, 1 ).$$

It is already the case in the quaternions that the appropriate integers to perform number theory contain half integers, this is even more true for the octonions (see a concise account in [1]). The half integers may be placed only in specific 4-subsets of the coordinates. It seemed appropriate to choose at least one factor of this form to achieve a low constant.

The next step by the Cayley-Dickson construction would be the 16-dimensional sedenions; however, the Hurwitz theorem states that there are no further normed real division algebras beyond dimension 8. In particular the multiplicativity of the norm does not hold any longer; consequently the analog matrix does not have orthogonal rows. Similar constructions might also be carried out in any other composition algebra, though a different definition of orthogonality would apply, i.e., instead of MM /latticetop one would consider something like MQM /latticetop for a matrix Q .

## References

- [1] J.H.Conway, D.A.Smith, On Quaternions and Octonions: Their Geometry, Arithmetic, and Symmetry, A.K.Peters Ltd., Natick, MA, 2003
- [2] L.Euler, Recherches sur un nouvelle espéce de quarrés magiques, Verhandelingen uitgegeven door het zeeuwsch Genootschap der Wetenschappen te Vlissingen 9 (1782), 85-239. Reprinted in Opera Omnia, I.7, 291-392.
- [3] L.Euler, Problema algebraicum ob affectiones prorsus singulares i memorabile, Novi commentarii academlae scientiarum Petropolitanae, 15 (1770) 1771, 75-106. Reprinted in Opera Omnia, I-6, 287-315

- [4] A.Hurwitz, Vorlesungen über die Zahlentheorie der Quaternionen, Springer, Berlin, 1919
- [5] SageMath, the Sage Mathematics Software System (Version 8.8) , The Sage Developers, 2019, https://www.sagemath.org .
Ísabel Pirsic
A parametrization of 8x8 magic squares of squares through octonionic multiplication
In an analogous construction as by Euler for 4x4 matrices, a parametrization
of 8x8 magic squares of squares with orthogonal rows is shown to be obtainable
by extending the quaternionic method, as shown by Hurwitz, to octonions, but
not possible to be carried even further in the Cayley-Dickson construction
series.