Enumerating extensions of mutually orthogonal Latin squares

Two n×n\documentclass[12pt]{minimal} \usepackage{amsmath} \usepackage{wasysym} \usepackage{amsfonts} \usepackage{amssymb} \usepackage{amsbsy} \usepackage{mathrsfs} \usepackage{upgreek} \setlength{\oddsidemargin}{-69pt} \begin{document}$$n \times n$$\end{document} Latin squares L1,L2\documentclass[12pt]{minimal} \usepackage{amsmath} \usepackage{wasysym} \usepackage{amsfonts} \usepackage{amssymb} \usepackage{amsbsy} \usepackage{mathrsfs} \usepackage{upgreek} \setlength{\oddsidemargin}{-69pt} \begin{document}$$L_1, L_2$$\end{document} are said to be orthogonal if, for every ordered pair (x, y) of symbols, there are coordinates (i, j) such that L1(i,j)=x\documentclass[12pt]{minimal} \usepackage{amsmath} \usepackage{wasysym} \usepackage{amsfonts} \usepackage{amssymb} \usepackage{amsbsy} \usepackage{mathrsfs} \usepackage{upgreek} \setlength{\oddsidemargin}{-69pt} \begin{document}$$L_1(i,j) = x$$\end{document} and L2(i,j)=y\documentclass[12pt]{minimal} \usepackage{amsmath} \usepackage{wasysym} \usepackage{amsfonts} \usepackage{amssymb} \usepackage{amsbsy} \usepackage{mathrsfs} \usepackage{upgreek} \setlength{\oddsidemargin}{-69pt} \begin{document}$$L_2(i,j) = y$$\end{document}. A k-MOLS is a sequence of k pairwise-orthogonal Latin squares, and the existence and enumeration of these objects has attracted a great deal of attention. Recent work of Keevash and Luria provides, for all fixed k, log-asymptotically tight bounds on the number of k-MOLS. To study the situation when k grows with n, we bound the number of ways a k-MOLS can be extended to a (k+1)\documentclass[12pt]{minimal} \usepackage{amsmath} \usepackage{wasysym} \usepackage{amsfonts} \usepackage{amssymb} \usepackage{amsbsy} \usepackage{mathrsfs} \usepackage{upgreek} \setlength{\oddsidemargin}{-69pt} \begin{document}$$(k+1)$$\end{document}-MOLS. These bounds are again tight for constant k, and allow us to deduce upper bounds on the total number of k-MOLS for all k. These bounds are close to tight even for k linear in n, and readily generalise to the broader class of gerechte designs, which include Sudoku squares.


Introduction
Latin squares have a long and storied history in combinatorics, sharing connections to several other areas of mathematics and enjoying applications in statistics and experimental design. In particular, orthogonal Latin squares are equivalent to many other classical structures in design theory, and their study dates back to Euler. In this paper we shall answer questions concerning the enumeration of orthogonal Latin squares, but we first present some of the relevant background.

Background and related work
We begin by recalling the definition of a Latin square, more in an effort to present our notation than in belief that you, the reader, do not know what a Latin square is.
Definition 1 A Latin square of order n is an n × n matrix with entries in [n] such that each x ∈ [n] appears exactly once in every row and in every column.
It is not difficult to see that Latin squares exist for all n; indeed, a rich class of constructions are given by the Cayley tables of groups. We refer the reader to [40] for more definitions, results and proofs related to Latin squares, noting only that the number of Latin squares is log-asymptotically given by Ryser [38] showed that the lower bound follows from Van der Waerden's conjecture on permanents of matrices, which was famously later proven by Egorychev [14] and Falikman [15]. The upper bound is also closely related to permanents, as it is a consequence of Brégman's Theorem [5] (see [40,Chapter 17] for details).
In this paper, we will be concerned with orthogonal Latin squares.
Definition 2 Two Latin squares L, L of order n are said to be orthogonal if, for all pairs (x, y) ∈ [n] 2 , there exist unique i, j ∈ [n] such that L(i, j) = x and L (i, j) = y. In this case, L is said to be an orthogonal mate of L.
A k-tuple of Latin squares (L 1 , . . . , L k ) forms a system of k mutually orthogonal Latin squares, or a k-MOLS, if for all 1 ≤ i < j ≤ k, the squares L i and L j are orthogonal.
Orthogonal Latin squares have proven interesting from both a theoretical and a practical point of view: they are related to various other classes of structures in design theory, some of which we shall encounter later, while having applications in many real-world problems. In light of these applications, the early research in this area concerned the existence of k-MOLS. In particular, there was much interest in the maximum size of a set of mutually orthogonal Latin squares; that is, the function N (n) = max{k : a k-MOLS of order n exists}.
It is well-known that N (n) ≤ n−1. Indeed, suppose (L 1 , . . . , L k ) is a k-MOLS. Observing that orthogonality is preserved under permutations of the symbols within each square, we may assume that the first row of each square is [1, 2, . . . , n]. Considering the entries in position (2, 1), we find that all L i (2, 1) must be distinct, by orthogonality, and different from 1, since the L i are Latin squares. Hence k ≤ n − 1.
One can further prove that one has equality if and only if a projective plane of order n exists. This shows that the precise determination of the function N (n) is likely to be difficult, as the existence of projective planes for orders n that are not prime powers is a longstanding open problem. Still, several polynomial lower bounds on N (n) with everimproving exponents appear in the literature [8,37,43], with the largest one due to Lu [31], who proved N (n) = Ω(n 1/14.3 ).
Given that large sets of mutually orthogonal Latin squares exist, it is natural to extend (1) and enumerate k-MOLS for k ≥ 2. Early work in this direction was undertaken by Donovan and Grannell [10], who constructed many k-MOLS, and also sought to bound the number of orthogonal mates a Latin square can have. An important component of their argument is an upper bound on number of transversals in a Latin square, where a transversal is a selection of n cells from the square, with no two sharing the same row, column or symbol. Taranenko [39] later proved a sharp upper bound on the number of transversals in a Latin square, which, when used in Donovan and Grannell's proof, shows that a Latin square can have at most (1)) n e 2+1/e n 2 (2) orthogonal mates. Coupled with (1), this can be used to give upper bounds on the number of pairs of orthogonal Latin squares and, more generally, the number of k-MOLS (since in a k-MOLS (L 1 , . . . , L k ), the Latin squares L 2 , . . . , L k must all be orthogonal mates of L 1 ).
More recently, tight bounds on the number of k-MOLS follow from the breakthroughs of Luria [32] and Keevash [26]. Through an elegant entropic argument, Luria gives a general upper bound on the number of perfect matchings a regular r -uniform hypergraph can have. Assuming certain pseudorandom conditions, Keevash provides a matching lower bound, coupling randomized constructions with the use of absorbers. When applied to the enumeration of k-MOLS, their theorems imply the following result, where we denote by L (k) (n) the number of k-MOLS of order n. Theorem 1 [27,32] For every fixed k ∈ N, the number of k-MOLS of order n is (3)

Results
The one drawback of Theorem 1 is that both the lower and upper bounds in (3) require k to be fixed as n tends to infinity. In this paper we seek upper bounds that hold when k grows with n. We combine the approach of Donovan and Grannell [10] with the method of Luria [32], using entropy to bound the number of ways of extending a k-MOLS by adding an additional Latin square. Before presenting our upper bound, let us discuss a lower bound for this number of extensions. Since every (k + 1)-MOLS contains a k-MOLS as a prefix, Theorem 1 implies that, for fixed k ∈ N, the average number of extensions of a k-MOLS to a (k + 1)-MOLS is at least This clearly gives a lower bound for the maximum number of such extensions. In the following theorem, we provide an upper bound that is valid for all k. (Throughout this paper, all logarithms are to the base e.) Theorem 2 For 0 ≤ k ≤ n − 2, the logarithm of the number of ways to extend a k-MOLS of order n to a (k + 1)-MOLS is at most We will estimate the value of this integral in Lemma 1. As a corollary, combining Theorem 2 with (4) allows us to determine the number of extensions of a k-MOLS of fixed size. In particular, setting k = 1 bounds the number of orthogonal mates a Latin square can have, sharpening the bound in (2).

Corollary 1
For every fixed k ∈ N, the maximum number of ways to extend a k-MOLS of order n to a (k + 1)-MOLS is As previously stated, our primary goal is to bound the number of k-MOLS when k grows with n. We can do so by building the k-MOLS one Latin square at a time, using Theorem 2 to bound the number of choices at each step. In this way we can recover the upper bound of Theorem 1 when k is constant, but the main novelty of this paper is the following extension to larger values of k.
Note that we trivially have L (k) (n) ≤ L(n) k , which, in light of (1), gives the upper bound log L (k) (n) ≤ kn 2 log n. Corollary 2 provides a significant improvement over this trivial bound. Furthermore, part (i) shows that the upper bound from Theorem 1 is valid whenever k = o log n log log n . It is well-known that mutually orthogonal Latin squares are equivalent to many other combinatorial structures such as transversal designs, nets and orthogonal arrays, while also being related to certain error correcting codes and affine and projective planes (see [40]), and so our results give upper bounds for the number of structures in each of these classes. In fact, we shall prove Theorem 2 for the more general class of gerechte designs (see Theorem 3), which allow us to, for instance, bound the number of sets of mutually orthogonal Sudoku squares. We discuss this particular extension further in our concluding remarks.

Organization
The remainder of this paper is organized as follows. In Sect. 2, we introduce gerechte designs and discuss an equivalent formulation that will be more convenient for our proof. We also review some basic notions about our main tool, entropy. Following that, we prove our results in Sect. 3. We then provide explicit constructions of Latin squares with many orthogonal mates in Sect. 4, and close with some further remarks and open problems in Sect. 5.

Designs and tools
In this section we will introduce the frameworks of gerechte designs and orthogonal arrays, in which we will prove a generalization of Theorem 2. We will also review some definitions and results regarding entropy that we shall require in our proofs.

Gerechte designs
Gerechte designs, defined below, are a special class of Latin squares introduced by Behrens in [2].
. A gerechte design of order n with respect to this partition is a Latin square with the additional property that each symbol appears exactly once in each region R i .
There are several natural examples of gerechte designs. For instance, if one takes the regions to be the n rows (or columns) of the n × n grid, a gerechte design is simply a Latin square. If n = m 2 , and one partitions the grid into n subsquares of dimension m × m, the corresponding gerechte designs are known as Sudoku squares of order n. Finally, given a Latin square L, define the regions R t = {(i, j) : L(i, j) = t} for all t ∈ [n]. A gerechte design with respect to this partition is an orthogonal mate of L.
It is natural to study orthogonality between Latin squares that are gerechte designs with respect to the same partition and, more generally, to consider systems of mutually orthogonal gerechte designs. Bailey, Cameron and Connelly [1] generalized the function N (n) to the setting of gerechte designs, giving upper bounds on the size of a set of mutually orthogonal gerechte designs that are tight for some orders n.
The counting questions concerning Latin squares discussed in the introduction can also be generalized to gerechte designs, and our method will allow us to derive bounds in this broader setting. For this, note that an n × n square with entries in [n] is a Latin square if and only if it is orthogonal (in the sense of Definition 2) to the square S n , given by S n (i, j) = i for all i, j ∈ [n], and its transpose. Similarly, it is not difficult to show that an n × n square with entries in [n] is a gerechte design with respect to the regions R 1 , . . . , R n if and only if it is orthogonal to the squares S n , S T n , and B, where B is given by B(i, j) = t if (i, j) ∈ R t . Note that, while the squares S n and S T n are orthogonal to each other, the square B need not be orthogonal to either (that is, B need not be a Latin square).

Orthogonal arrays and nearly orthogonal arrays
When adding a square to a set of mutually orthogonal gerechte designs, we need to ensure three properties: that it is a Latin square, that it respects the regions of the design, and that it is orthogonal to the previous squares. For our proof, it will be helpful to use an equivalent but more symmetric formulation of mutually orthogonal gerechte designs, where these three properties all take the same form. We begin in the setting of mutually orthogonal Latin squares.
Definition 4 Let x, y be vectors in [n] n 2 . We say that x and y are orthogonal if, for all pairs (s, t) ∈ [n] 2 , there exists a unique index such that x = s and y = t. An orthogonal array O A(n, d) is an n 2 × d array A with entries in [n] such that all pairs of its columns are orthogonal.
We note that in the literature orthogonal arrays are often defined more generally and Definition 4 describes what is known as an orthogonal array with strength two and index one. For the sake of simplicity, we omit the general definition and refer the reader to [20] for more about orthogonal arrays.
We now extend these ideas to mutually orthogonal gerechte designs. Let v 3 be a vector in [n] n 2 with each integer in [n] appearing n times. Note that v 3 determines a partition of the elements of [n 2 ] (and thus [n] 2 , after we fix a linear ordering of this set) into n equally-sized regions. From the equivalence between mutually orthogonal Latin squares and orthogonal arrays and the discussion at the end of Sect. 2.1, we can conclude that an O A(n, k + 2), whose first two columns are v 1 and v 2 , and in which all other columns are also orthogonal to v 3 , is equivalent to k mutually orthogonal gerechte designs with respect to the partition determined by v 3 . For notational convenience, we add the column v 3 to the array and call the resulting structure an n 2 × (k + 3) nearly orthogonal array.

Definition 5
Given n ∈ N and d ≥ 3, a nearly orthogonal array N O A(n, d) is an n 2 × d array A with symbols [n] such that: (a) the first column is v 1 and the second column is v 2 , as defined above, (b) each symbol in [n] appears exactly n times in the third column v 3 , and (c) for all i ≥ 4, the ith column v i is orthogonal to all other columns in A.
Again, it follows that the number of nearly orthogonal arrays N O A(n, k + 3) is equal to the number of sets of k mutually orthogonal gerechte designs with respect to the partition defined by v 3 .

Entropy
The proof of our main result is based on entropy. This method has previously given good asymptotic upper bounds for similar problems; for instance, it is used in [36] to prove Brégman's Theorem on the permanent of a matrix (which yields an asymptotically tight upper bound on the number of Latin squares), in [28] to show an upper bound on the number of Steiner triple systems, later shown to be tight in [27], and in [17] to provide a simpler proof of Taranenko's result on the maximum number of transversals in a Latin square, also shown to be tight in the same paper; see also [32] for some further applications. In this section, we review some basic facts about entropy that will be used in our proof. For more on entropy, see [9].
Let X be a discrete random variable taking values in a given finite set S, and let p(x) = Pr[X = x] for all x ∈ S. The (base e) entropy of X is given by where we adopt the convention that 0 log 0 = 0. The entropy of X can be seen as a measure of the amount of information the random variable encodes. It is not difficult to show that where R(X ) = {x ∈ S : p(x) > 0} is the range of the random variable, with equality if and only if X is uniformly distributed over R(X ). This definition can be extended to multiple random variables in the natural way. We define the joint entropy of two random variables X and Y to be The conditional entropy of X given Y is defined to be Conditional entropy gives us a way to measure how much additional information we expect to learn from X once we know the value of Y . It is a simple exercise to show that the joint entropy and the conditional entropy of several random variables satisfy the following equality, known as the chain rule: We end this section by outlining the basic idea behind counting proofs based on entropy. Suppose we want to obtain a bound on the size of a set S. We sample an element X ∈ S uniformly at random. By the above discussion, we have H (X ) = log |S|, and so an upper bound on the entropy H (X ) yields an upper bound on |S|. To bound H (X ), we break up the random variable X into simpler random variables; the chain rule then allows us to consider these new random variables one at a time.

Proofs of our results
We now use the material from the previous section to prove Theorem 2 and its corollaries.

Bounding the number of extensions
In the language of orthogonal arrays, Theorem 2 is a statement about the number of ways to extend an orthogonal array by one column. We will in fact prove the following more general result, bounding the number of ways to extend a nearly orthogonal array by one column. Indeed, by inserting a copy of the first column in the third column (and reordering the rows if needed), one obtains a nearly orthogonal array from an orthogonal array. Then the logarithm of the number of ways to extend A to a nearly orthogonal array with d + 1 columns is at most

Theorem 3 Given n ∈ N and d ≥ 3, let A be a nearly orthogonal array N O A(n, d). For each row
Observe that in the gerechte design setting, for a cell ∈ [n] 2 , r counts the number of other cells in the same row and region as , while c counts the number of cells sharing the same column and region.
Before proving Theorem 3, we quickly derive Theorem 2. We now proceed to the proof of the general theorem.

Proof of Theorem 3
Let A be as given, and let S denote the set of column vectors that are valid extensions for A. Our goal is to bound |S|. We can assume S = ∅, otherwise we are done. Let X ∈ S be chosen uniformly at random. Then H (X ) = log |S|, and so it suffices to bound the entropy of X . We will expose the coordinates of X one at a time, using the chain rule to express the total entropy H (X ) as the sum of the conditional entropies from each successive reveal.
For ∈ [n 2 ], we denote the th coordinate of X by X and, given a permutation π of [n 2 ], we reveal the coordinates in the order X π(1) , X π(2) , . . . , X π(n 2 ) . The chain rule then gives Given x ∈ [n] n 2 , let R π( j) (π, x) = R(X π( j) |X π(s) = x π(s) : s < j) denote the range of this conditional random variable, that is, and let N π( j) (π, x) = R π( j) (π, x) be the size of this range. Note that R π( j) (π, x), and hence also N π( j) (π, x), only depends on the first j − 1 coordinates of x with respect to π; for s ≥ j, the values x π(s) can be chosen arbitrarily without changing the range of the random variable. Thus, by (5), we can bound the conditional entropy by H (X π( j) |X π(s) = x π(s) : s < j) ≤ log N π( j) (π, x) for all x ∈ [n] n 2 . Substituting this into (6) and reordering the sum gives (N (π, x)) .
This bound holds for any permutation π, and thus it holds when we average over the choice of π. As our calculations are more convenient in the continuous setting, we sample the uniformly random permutation of [n 2 ] by choosing a vector α = (α ) n 2 =1 with α ∼ U [0, 1] for all and defining π α = π to be such that α π(1) > α π(2) > · · · > α π(n 2 ) . We then have where the last inequality follows from Jensen's inequality and the concavity of y → log y. It therefore suffices to show that, for all ∈ [n 2 ] and all x ∈ S, we have We first estimate the inner expectation E α|α [N (π, x)] = E α [N (π, x)|α ]. By the linearity of expectation, this is equal to y∈ [n] P [y ∈ R (π, x)|α ]. Unfortunately, it is not straightforward to determine whether or not y ∈ R (π, x), and so we shall instead use a simple necessary condition that we call availability.
Recall that for the column x to be orthogonal to the ith column of A, the pairs (A(s, i), x s ) must be distinct for all s ∈ [n 2 ]. Therefore, if for some symbol y ∈ [n] there is some column i ∈ [d] and previously exposed coordinate s such that A(s, i) = A( , i) and x s = y, we cannot also have x = y. In this case we declare y unavailable, and observe that we must have y / ∈ R (π, x). Otherwise, if there is no such column i and coordinate s, we say y is available. We now seek to compute the probability that a symbol y is available.
Fix a symbol y ∈ [n]. If y is the true value of the entry in the th coordinate of x, then y cannot possibly have been ruled out by the previously exposed entries, and is thus available with probability 1.
Now suppose y ∈ [n] is not the true value of x . For each i ∈ [d], since x is orthogonal to the ith column of A, there must be a unique entry s i (y) = such that x s i (y) = y and A(s i (y), i) = A( , i). In order for y to be available, must be exposed before the entries in the set S(y) = {s i (y) : i ∈ [d]}.
To find the probability of y being available, then, we need to compute the size of S(y). Suppose for distinct columns 1 ≤ i < j ≤ d we had s i (y) = s j (y). It then follows that A(s i (y), i) = A( , i) and A(s i (y), j) = A( , j), and thus the ith and jth columns cannot be orthogonal. Since A is nearly orthogonal, the only possibilities are i ∈ {1, 2} and j = 3 (by definition, all columns after the third column are orthogonal to all others, and the first two columns are orthogonal by construction).
Therefore |S(y)| = d, unless either s 1 (y) = s 3 (y) or s 2 (y) = s 3 (y). Note that these cannot happen simultaneously, as we have ruled out s 1 (y) = s 2 (y), and thus in these cases we have |S(y)| = d − 1. There are r choices of s = for which A(s, 1) = A( , 1) and A(s, 3) = A( , 3), and hence r values y for which s 1 (y) = s 3 (y). By orthogonality of x with the first column of A, these values are all distinct. Similarly, there are c choices for y with s 2 (y) = s 3 (y).
To summarize, there is one choice of y that is available with probability 1, there are r + c choices of y that are available only if the th coordinate is exposed before some fixed set of d − 1 other coordinates, and the remaining n − r − c − 1 choices of y are available only if the th coordinate precedes some d other coordinates.
A coordinate s is revealed after if α s < α , which occurs with probability α . Moreover, these events are independent for distinct coordinates, and so the probabilities in the latter two cases are α d−1 and α d respectively. This gives Pr [y is available] Since α is uniformly distributed over [0, 1], substituting this into E α [log (E α|α [N (π, x)])] results in (7), completing the proof.

Estimating the integral
In order to apply Theorem 2, we need to understand the asymptotics of the bound it provides. In this next lemma, we show how to estimate the integral from the theorem.
We estimate the three integrals in turn: where for the inequality we use the fact that log(1 + x) ≤ x for all x > −1, and in the final equality we use where the penultimate equality again follows from t d 0 = (n − 1) −1 , and 1 t 0 Hence, we have where we ignore the negative term and bound 1 d+1 Corollary 1 now follows easily from Theorem 2 and Lemma 1. (3). For the upper bound, Theorem 2 asserts that the logarithm of the number of extensions of a k-MOLS of order n is, in the notation of Lemma 1, at most n 2 I k+2 .

Proof of Corollary 1 The lower bound comes from the average number of extensions of a k-MOLS, computed in
By the lemma, this is bounded by Since k is fixed as n tends to infinity, this is giving the desired upper bound.
Finally, we deduce our upper bound on the number of large sets of mutually orthogonal Latin squares.

Proof of Corollary 2
We can build a k-MOLS by starting with the empty 0-MOLS, and extending it by one Latin square at a time. Theorem 2 bounds the number of possible extensions at each step, and so, in the notation of Lemma 1, we have We shall prove each part of the corollary by estimating this sum appropriately.
(i) By Lemma 1, we have

Hence, summing over d, we obtain
from which the bound follows. Note that when k = o(log n), the final summand is a lower order term compared to k 2 , and we can be generous in our estimation. (ii) When k = Ω(log n), that final term above becomes significant. While the previous upper bound remains valid, we obtain a better result through more careful calculation. Rearranging the bound in Lemma 1 gives Therefore we have The second sum, an error term, is at most 3 log(k + 1). For the first sum, by making the substitution x = d log(n−1) , we observe that this is related to the estimation of the integral x 1 − e −1/x dx by the Riemann sum with step size 1/ log(n − 1). More precisely, we have Making the necessary substitutions and letting n tend to infinity gives the claimed bound. (iii) When k = ω(log n), the above integral has an infinite domain, but we shall show that it still converges. First, we estimate e −1/x to observe that where the asymptotics are as x tends to infinity. Hence, when β tends to infinity, The result then follows by substituting this into the statement of part (ii) with β = k log n ; since the integrand x 1 − e −1/x is bounded and monotone increasing for large x, the Riemann sum remains a good approximation of the integral when β → ∞.

Explicit constructions
Corollary 1 establishes the existence of Latin squares with several orthogonal mates. Given the numerous applications of orthogonal Latin squares, however, it is of great interest to have explicit constructions of such squares. For instance, in the closely related problem of counting transversals in Latin squares, Taranenko [39] showed that a Latin square of order n can have at most (1 + o(1)) n e 2 n transversals. Glebov and Luria [17] later proved that Taranenko's bound is tight via a probabilistic construction. Recent results of Eberhard et al. [12] and Eberhard [11] give a constructive proof of the theorem of Glebov  This lower bound is much smaller than the upper bound we would like to match, because this simple argument only counts orthogonal mates of a very special type. Here we describe a construction of MacNeish [33] that allows us to significantly improve this bound, even if we still fall slightly short of the true maximum number of orthogonal mates given by Corollary 1.
The Kronecker product of two Latin squares L 1 and L 2 of order n 1 and n 2 respectively is the Latin square L 1 ⊗ L 2 of order n 1 n 2 given by ( j 2 )). (Of course, the row and column indices and the symbols of L 1 ⊗ L 2 can be seen as elements of [n 1 n 2 ] after fixing an arbitrary bijection from [n 1 ] × [n 2 ].) For a Latin square L, we write L ⊗k to denote the k-fold product L ⊗ · · · ⊗ L k times . Proposition 1 Let L 1 and L 2 be Latin squares of order n 1 and n 2 that have q 1 and q 2 orthogonal mates respectively. Then the number of orthogonal mates of L 1 ⊗ L 2 is at least q 1 q n 2 1 2 (n 1 n 2 )! n 1 !(n 2 !) n 1 .
Proof We will show how orthogonal mates of L 1 and L 2 can be combined in several ways to produce orthogonal mates of the product L 1 ⊗ L 2 . For this, it is again useful to view an orthogonal mate as an ordered partition of L 1 ⊗ L 2 into disjoint transversals.
Further observe that L 1 ⊗ L 2 can be partitioned into n 2 1 blocks of the form L 1 (i 1 , i 2 ) ⊗ L 2 for i 1 , i 2 ∈ [n 1 ]. Each of these is isomorphic to L 2 , and thus admits q 2 orthogonal mates.
There are q 1 orthogonal mates of L 1 , and thus q 1 n 1 ! unordered partitions of L 1 into disjoint transversals, say {T 1 , . . . , T n 1 }. In the product L 1 ⊗ L 2 , this partitions the blocks into n 1 disjoint sets.
Let T j be one of the transversals in this decomposition of L 1 . The corresponding blocks T j ⊗ L 2 = {L 1 (i 1 , i 2 ) ⊗ L 2 : (i 1 , i 2 ) ∈ T j } then have all distinct symbols from [n 1 ] in the first coordinate, and hence cover each symbol in [n 1 ] × [n 2 ] precisely n 2 times. To get a transversal of L 1 ⊗ L 2 , we can choose a transversal in each block L 1 (i 1 , i 2 ) ⊗ L 2 and stitch them together. Furthermore, if we partition each block into transversals, stitching them together gives a partition of T j ⊗ L 2 into transversals of L 1 ⊗ L 2 .
There are q n 1 2 ways to choose orthogonal mates for each of the n 1 blocks in T j ⊗ L 2 . Here we keep the ordering, as that tells us which transversals in different blocks should be stitched together. This gives us an ordered partition of T j ⊗ L 2 into n 2 transversals of L 1 ⊗ L 2 , and so there are q n 1 2 n 2 ! unordered partitions of this set of blocks into transversals.
Making these choices for each T j , we obtain a total of q 1 n 1 ! q n 1 2 n 2 ! n 1 partitions of L 1 ⊗ L 2 into n 1 n 2 disjoint transversals, each of which can easily be shown to be distinct. To obtain an orthogonal mate, we can order these transversals arbitrarily, and thus obtain q 1 q n 2 1 2 (n 1 n 2 )! n 1 !(n 2 !) n 1 mates, as claimed.
In particular, this implies that powers of a single Latin square have many orthogonal mates. Proof We proceed by induction. The statement is clearly true for k = 1. Suppose it holds for some k ≥ 1. Then, by Proposition 1, with L 1 = L ⊗k , L 2 = L, n 1 = m k , n 2 = m, q 1 = m 2k −1 m 2 −1 , and q 2 = q, we know the number of mates of L ⊗(k+1) is at least If we take L to be the Cayley table of Z 3 , then we have q = 6. The k-fold Kronecker product of the Cayley table gives the Cayley table of the product group Z k 3 , which by Corollary 3 has at least (6 1/8 ) 3 2k −1 orthogonal mates. In the next corollary, we show that the constant in the base of the exponent can be made arbitrarily large at the cost of having a slightly less explicit construction.

Concluding remarks and open questions
In this paper, by bounding the number of extensions of a set of mutually orthogonal Latin squares, we obtained upper bounds on the number of k-MOLS when k grows with n. The obvious question is how tight these bounds are -can we find corresponding lower bounds?
The constructions of Donovan and Grannell [10], valid for infinitely many values of n when k ≤ √ n, give lower bounds of the form log L (k) (n) = Ω γ (k, n)n 2 log n , where γ (k, n) = max log k k 2 log n , 1 k 4 . This is considerably smaller than our upper bounds in Corollary 2, and it would be of great interest to narrow the gap. One might hope to extend the lower bounds of Keevash [26], which were tight for constant k, but, as he notes in his paper, it is unclear how his methods could be used when k grows.
Aside from the enumeration of k-MOLS, there are several other related open problems, and we elaborate on these possible directions of study below.

Orthogonal mates
We have bounded the maximum number of orthogonal mates a Latin square can have, but it is natural to ask if it is typical for a Latin square to have any orthogonal mates at all. Computational results in this direction are given in [6,13,34]. His study of squares of small order led van Rees [41] to conjecture that, as n → ∞, the proportion of Latin squares without orthogonal mates tends to one. On the other hand, having studied slightly larger orders, Wanless and Webb [42] suggested that the opposite may be true.
In (4), we saw that the results of Luria [32] and Keevash [26] imply that the average Latin square of order n has (1 + o(1)) n e 3 n 2 orthogonal mates. By Theorem 2, the same expression describes the maximum number of mates a square can have. Given the number of Latin squares (see (1)), it follows by double-counting orthogonal pairs that at least squares must have an orthogonal mate. Unfortunately, due to the lower order difference compared to (1) being in the base of the exponent, this falls short of resolving the question of whether or not most Latin squares have orthogonal mates.
Some evidence that this may not be straightforward to resolve is provided in [7], where Cavenagh and Wanless showed that, for almost all even n, there are at least n (1−o(1))n 2 Latin squares of order n without a transversal, let alone an orthogonal mate. However, Ferber and Kwan [16] study the analogous question in Steiner triple systems, and show that almost all Steiner triple systems are almost resolvable. In the context of Latin squares, they suggest that their methods would show that almost all Latin squares have (1 − o(1))n disjoint transversals. Still, some new ideas would be needed to find the n disjoint transversals that form an orthogonal mate.
In Sect. 4 we showed, for any given C > 0, that we can, for infinitely many n, construct Latin squares of order n with at least C n 2 orthogonal mates. Given the existence of Latin squares with many more, namely n (1+o(1))n 2 , orthogonal mates, it is natural to seek better constructions.

Problem 1
Is there an explicit construction of a Latin square of order n with at least n Ω(n 2 ) orthogonal mates?
In our product construction in Sect. 4, we only considered orthogonal mates consisting of very special kinds of transversals (those built within blocks, using transversals of the two factor squares). It is likely that these product squares have a much larger number of orthogonal mates, perhaps even close to the maximum possible.
We have also been vague with regards to what we mean by an explicit construction. As is customary in computer science, by explicit we mean there is an algorithm that constructs the Latin square in question in time polynomial in n. One can go further, and call a construction strongly explicit if each individual entry of the Latin square can be determined in polylogarithmic time. One can verify that our construction in the previous section is indeed strongly explicit. Yet one feels somewhat cheated, as in the first step of the construction we perform an exhaustive search to find an initial Latin square with many orthogonal mates (whose existence is guaranteed by random methods, see Corollary 1). It would be desirable to find constructions that are also "morally explicit" in the sense that they can be described mathematically, and in particular avoid any initial brute-force search. In this direction, it would be natural to investigate whether the Cayley tables of abelian groups G with g∈G g = 0 give examples of such Latin squares (cf. [11,12]).
Affine and projective planes As mentioned earlier, (n − 1)-MOLS of order n correspond to affine, and hence projective, planes of order n. Our knowledge of lower bounds in this setting is even direr; it is conjectured that there are no such systems when n is not a prime power, and believed that there is a unique (up to isomorphism) projective plane when n is a prime. As a step towards proving these conjectures, one could seek to bound the number of affine/projective planes from above, a problem raised by Hedayat and Federer [19].
In our definition of L (k) (n), we do not account for isomorphism. Thus, given a single projective plane, we can permute the symbols within each square of the corresponding (n−1)-MOLS to obtain (n!) n−1 distinct (n − 1)-MOLS. This gives a lower bound of L (n−1) (n) ≥ (n!) n−1 = e (1−o(1))n 2 log n whenever n is a prime power. We remark that, for certain prime powers n, Kantor [22] and Kantor and Williams [23] provide algebraic constructions of superpolynomially many non-isomorphic projective planes of order n, but this contributes a lower order term in the above bound.
For an upper bound, Corollary 2 yields L (n−1) (n) ≤ e 1 2 +o(1) n 2 log 3 n . However, since a projective plane corresponds to a maximum possible set of mutually orthogonal Latin squares, it has a very restricted structure, and we can take advantage of this to obtain a better upper bound. Given a projective plane n of order n, a subset H of its lines is called a defining set if n is the unique projective plane containing H -that is, the lines in H determine the remaining lines in n . Building on the work of Kahn [21], Boros et al. [4] showed that every projective plane admits a small defining set.
Theorem 4 [4] Every projective plane of order n (for n sufficiently large) contains a defining set of size at most 22n log n.
Proof By Theorem 4, each projective plane of order n contains a set H of 22n log n lines that determine the remaining ones uniquely. Each line is a subset of size n + 1 of the n 2 + n + 1 points. Thus, there are n 2 +n+1 n+1 = e (1+o(1))n log n possible lines and at most (e (1+o(1))n log n ) 22n log n possible sets H and hence projective planes of order n.
Each (n − 1)-MOLS corresponds to an affine plane of order n (the n 2 cells represent the points, two parallel classes are formed by the rows and columns, and each of the n − 1 Latin squares labels the lines of one of the remaining parallel classes), and every affine plane has a unique extension to a projective plane (for each parallel class, we extend the lines to a common new point, and add a line at infinity consisting of the new points). In the reverse direction, a projective plane corresponds to at most n 2 + n + 1 different affine planes, by choosing the line at infinity. Furthermore, each affine plane corresponds to at most (n + 1)!(n!) n+1 = e (1+o(1))n 2 log n distinct (n − 1)-MOLS, since we can permute the parallel classes, and the lines within parallel classes. This contributes a lower order term, and so we can also bound L (n−1) (n) ≤ e (22+o(1))n 2 log 2 n .
It would be of great interest to remove the extra logarithmic factor in the exponent of the upper bound, and thus reduce it log-asymptotically to the lower bound.
As we obtain this many (n − 1)-MOLS from a single projective plane, this would provide qualitative evidence in favor of the non-existence conjectures concerning projective planes. Note that a stronger result than Conjecture 1 (and a possible avenue of attack) would be to improve Theorem 4, which is not known to be tight. The best known lower bound for Theorem 4 is only linear in n, and, if every projective plane were to indeed contain a defining set of O(n) lines, that would imply L (n−1) (n) = e Θ(n 2 log n) .
Sudoku squares As mentioned in Sect. 2.1, Sudoku squares are a special class of gerechte designs of order n, where n = m 2 , with the array partitioned into m × m subsquares in the natural way. After Golomb [18] asked about the existence of a pair of orthogonal Sudoku squares of order 9 (corresponding to the popular puzzle), systems of k mutually orthogonal Sudoku squares (k-MOSS) have been studied by several authors. This research has primarily sought to determine the largest k for which a k-MOSS of order n can exist; we refer the reader to [1,24,25,29,30,35] for constructions and results in this direction. One may ask the same counting questions as before for this restricted class of Latin squares, and these are relatively less well-studied. The number of Sudoku squares of order n 2 1 0 log 1 + 2( √ n − 1)t k+2 + (n − 2 √ n + 1)t k+3 dt = n 2 1 0 log 1 + (n − 1)t k+3 dt + n 2 1 0 log 1 + 2( √ n − 1)(1 − t)t k+2 1 + (n − 1)t k+3 dt.
The first integral is simply I k+3 , as evaluated in Lemma 1.
To bound the second integral, observe that Thus, even if we sum up over all k ∈ [n], the contribution from this second integral is a lower order error term. Hence our upper bound on the logarithm of the number of extensions of a k-MOSS is n 2 (I k+3 + o(1)), and therefore we obtain the same enumeration as when extending a (k + 1)-MOLS.
Aside from the general lower bound of Keevash [26], we are not aware of any lower bounds on the number of k-MOSS. It would therefore be interesting to find lower bounds on the number of k-MOSS when k grows with n.
Problem 2 How tight are the upper bounds in Corollary 6(b)? That is, for k = k(n) that grows with n, can we show the existence of many distinct k-MOSS?