The pair of orthogonal diagonal Latin squares, (ODLS), that make a (Graeco-Latin) magic square, are here called Q, (quotient), and R, (remainder). The magic square is made as:

M[r][c] = n x Q[r][c] + R[r][c] + 1, 0 ≤ r,c < n

which for a SODLS is equivalent to:

M[r][c] = n x Q[r][c] + Q[c][r] + 1

The number of SODLS is 4 times the number of unique magic squares because 4 SODLS (aspects) make 4 aspects of the same magic square.

The nfr, (natural order first row), numbers were obtained by a backtracking program.

With the exception of order 9, all (nfr x n!) SODLS and magic squares were written to disk for analysis. For order 9, only nfr SODLS and associative and pandiagonal magic squares were written to disk, the others being counted, type checked, and discarded.

For orders 4, 5, and 7, all the numbers were determined by backtracking and confirmed by permutation of the nfr.

The orders 8 and 9 numbers were obtained by permutation of the nfr, and the associative numbers were checked by backtracking. Francis Gaspalou's order 8 number 1,152 is confirmed.

For SODLS the orientation, (aspect), has to be considered.

The four aspects of a SODLS that keep the diagonals in the same position, make four aspects of a magic square.

For some orders, the other four aspects, in which the positions of the forward and back
diagonals are reversed, make four aspects of a different magic square.

Miguel Angel Amela refers to such a SODLS as a:

*Doubly Self-Orthogonal Diagonal Latin Square* (orthogonal to its transpose
and its antitranspose)

The term "doubly self-orthogonal Latin square"
was coined by Kim and Kumar.

Miguel has extended this to quadruply and sextuply self-orthogonal Latin squares. See
6-SOLS 9x9.pdf.

Here is an order 4 doubly SODLS example.
The **blue** square aspects are made from the Q aspect and its transpose,
(rotation about the **blue** diagonal):

M[r][c] = n x Q[r][c] + Q[c][r] + 1

The **red** square aspects are made from the Q aspect and its antitranspose,
(rotation about the **red** diagonal):

M[r][c] = n x Q[r][c] + Q[n-1-c][n-1-r] + 1

All SODLS of order 4, 5, 7, and 8 are doubly self-orthogonal.

For some other orders a SODLS may not be orthogonal to its antitranspose, (when superposed with the antitranspose, some symbol overlays are duplicated, and some are missing).

For order 9, some SODLS are doubly self-orthogonal and some are not.
Of the 224,832 nfr, natural order first row, 28,608 are doubly SODLS and 196,224 are singly SODLS.
These numbers are confirmed by Francis Gaspalou,
(June, 2016).

Example:

There is no doubly SODLS of order 10. See Lu, Liu and Zhang

Program MagicSquaresSODLS uses Planck's "A-D method" to convert some associative SODLS to weakly pandiagonal SODLS. This works for the associative SODLS made by the program. However, for some associative SODLS, the result is only a SOLS. There are duplicate symbols on a main diagonal.

For order 8, converting all 36,864 unique associative SODLS makes 21,504 weakly pandiagonal SODLS.
The rest, even though they do make pandiagonal complete magic squares,
are not **diagonal** Latin squares. There are duplicated symbols on a main diagonal. Example:

A Latin square in which each symbol also occurs exactly once in each of the **n** left
and **n** right diagonals.
The design is credited to Knut Vik, (1881-1970), a Norwegian agricultural professor who presented such an
order 5 square in 1924.

There are no pandiagonal or associative Latin squares of singly-even order.

Consider a **4k+2, k≥1**, LS.
Let **n** be the order of the LS, **m** = **n/2**,
and **Σ** the line sum, i.e., sum of row, column, or diagonal.

**Σ = 0 + 1 + .. + (n-2) + (n-1) = m(n-1)**.

For singly even, **m** is odd, and **n-1** is odd,
so **Σ** is odd and **mΣ** is an odd number.

There are only weakly pandiagonal Latin squares of even order, ( SOWPLS), but there are none of these for singly-even order.

A proof is similar to that of Planck for pandiagonal magic squares. See reference.

Let the LS cells be divided into four types as shown in Planck's figure:

Let the sum of the numbers in all the
cells = W, in all the
cells = X, and all
cells = Y. Then by summing all the numbers in rows 1, 3, 5, .. we have
**W + X = mΣ**.
Similarly for columns 1, 3, 5, .. we have **W + Y = mΣ**, and for alternate /diagonals we have
**X + Y = mΣ**.

Thus, **W = X = Y = mΣ/2** which cannot be, because if
**mΣ** is odd, **mΣ/2** is fractional.

There are no associative Latin squares of singly-even order. A proof is similar to one for associative magic squares.

Define **complement pairs** as pairs of numbers that sum to **n-1**.
Let the LS have complement pairs (**a A**),
(**b B**), ... and let **W, X, Y** be the sums of LS quarters:

Summing rows:And, if the LS is associative:W + X = mΣSumming columns:W + Y = mΣ

Summing complement pairs:X + Y = m²(n-1) = mΣ

Thus, **W = X = Y = mΣ/2** which cannot be, because if
**mΣ** is odd, **mΣ/2** is fractional.

SODLS are made with natural order first row 0 1 2 3 ... . All SODLS have been made up to order 9; some have been made of orders 10 and 11. With permutations, each SODLS can be converted into N! SODLS.

SSSODLS are made with natural order \diagonal 0 1 2 3 ... . All SSSODLS have been made up to order 9; some have been made of orders 11, 12, 13, 15, and 16. With permutations, each SSODLS can be converted into N! SODLS. Those that preserve center symmetry will be SSSODLS, (odd: 2x4x6x..x(N-1), even 2x4x6x..xN).

SODLS are made with natural order first row: 0 1 2 3 4 5 6 7 8 9.

Input is a text file containing either a \diagonal minus the starting 0 or a full order 10 SODLS.

If input is a \diagonal, there is a prompt for input of a value for the second position of the /diagonal. The program will then make all the SODLS of that configuration, (i.e., with those values in those positions). Example:

There are 176 SODLS of this configuration. Of the 16 configurations that have been run, the number of SODLS ranges from 163 to 247, averaging 200. Each run requires from 4 to 7 days to complete on a 3.0 GHz PC.

All the valid \diagonals, (minus their starting 0), are provided in files
SODLS10d2,
SODLS10d3,
SODLS10d4,
SODLS10d5,
SODLS10d6,
SODLS10d7,
SODLS10d8,
SODLS10d9.

There are 16687 for each second value 2 .. 9; total 133496.

If input is a full SODLS, the program will make the remaining SODLS, if any, with that \diagonal and value in the second position of the /diagonal. This is intended for completing an interrupted run with a \diagonal input. Example:

This is the second last SODLS of this configuration so the program will make just the last one.