Skip to main content
2 of 2
Minor clarifications
AxiomaticSystem
  • 13.2k
  • 25
  • 49

I don't know how to enumerate all the "perfect Latin squares", so I started off by enumerating all the possible templates: sets of rows satisfying the domino and Latin criteria. A template in itself creates a perfect Latin square if it is symmetric around either the center or the main diagonal, but it does not rule out the possibility that some permutation of rows, columns, and/or numbers creates another possibly-asymmetric perfect square, with row set and column set possibly belonging to different templates.

There are no templates for sizes 3, 5, or 7, so there are no squares of those sizes.

There is one template for sizes 2 and 4, two templates for size 6, and twelve for size 8:
enter image description here
The first eight size-8 templates are mostly identical, except for a reflection that changes the shown cells. Of interest, however, are the last four, which are diagonally symmetric instead of rotationally symmetric. (Note that my code does not force any symmetry except for that of the initial row and column.)

AxiomaticSystem
  • 13.2k
  • 25
  • 49