TOPICS
Search

Latin Square


A Latin square of order n is an n×n array that is a Latin rectangle with k=n. Its n^2 entries are chosen from n symbols, each appearing exactly once in every row and every column. For example, the two Latin squares of order two are given by

 [1 2; 2 1],[2 1; 1 2],
(1)

the 12 Latin squares of order three are given by

  [1 2 3; 2 3 1; 3 1 2],[1 2 3; 3 1 2; 2 3 1],[1 3 2; 2 1 3; 3 2 1],[1 3 2; 3 2 1; 2 1 3],
 [2 1 3; 1 3 2; 3 2 1],[2 1 3; 3 2 1; 1 3 2],[2 3 1; 1 2 3; 3 1 2],[2 3 1; 3 1 2; 1 2 3],
 [3 2 1; 1 3 2; 2 1 3],[3 2 1; 2 1 3; 1 3 2],[3 1 2; 1 2 3; 2 3 1],[3 1 2; 2 3 1; 1 2 3],
(2)

and two of the 576 Latin squares of order 4 are given by

 [1 2 3 4; 2 1 4 3; 3 4 1 2; 4 3 2 1]  and  [1 2 3 4; 3 4 1 2; 4 3 2 1; 2 1 4 3].
(3)
LatinSquareGraphs

Latin squares correspond to minimum vertex colorings of the n×n rook graph, which are illustrated above for n=2 and 3.

The numbers N(n,n) of Latin squares of order n=1, 2, ... are 1, 2, 12, 576, 161280, ... (OEIS A002860). The numbers I(n) of isotopically distinct Latin squares of order n=1, 2, ... are 1, 1, 1, 2, 2, 22, 564, 1676267, ... (OEIS A040082).

A pair of Latin squares is said to be orthogonal if the n^2 pairs formed by juxtaposing the two arrays are all distinct. For example, the two Latin squares

 [3 2 1; 2 1 3; 1 3 2]    [2 3 1; 1 2 3; 3 1 2]
(4)

are orthogonal. The numbers of unordered pairs of orthogonal Latin squares of order n=1, 2, ... are 1, 0, 36, 3456, ... (OEIS A072377). The count at order 1 includes the unique Latin square paired with itself.

The number of Latin squares of order n with first row given by {1,2,...,n} is the same as the number of fixed diagonal Latin squares of order n (i.e., the number of Latin squares of order n having all 1s along their main diagonals). For n=1, 2, ..., the numbers of such matrices are 1, 1, 2, 24, 1344, 1128960, ... (OEIS A000479) and the total number of Latin squares of order n is equal to this number times n!.

A normalized, or reduced, Latin square is a Latin square with the first row and column given by {1,2,...,n}. General formulas for the number of normalized n×n Latin squares L(n,n) are given by Nechvatal (1981), Gessel (1987), and Shao and Wei (1992), but a sharp asymptotic equivalent for L(n,n) is not known (McKay and Wanless 2005, p. 336). The total number of Latin squares N(n,n) of order n can then be computed from

 N(n,n)=n!(n-1)!L(n,n).
(5)

The known growth on a logarithmic scale is lnN(n,n)=n^2lnn-2n^2+o(n^2) (Linial and Luria 2014), where o denotes little-O notation.

The numbers of normalized Latin squares of order n=1, 2, ..., are summarized in the following table (OEIS A000315). As of November 2026, exact values are known only through order 11. The entries for n=12, 13, 14, and 15 are estimates (McKay and Rogoyski 1995).

nL(n,n)reference
11
21
31
44
556Euler (1782), Cayley (1890), MacMahon (1915; incorrect value)
69408Frolov (1890) and Tarry (1900)
716942080Frolov (1890; incorrect), Norton (1939; incomplete), Sade (1948), Saxena (1951)
8535281401856Wells (1967)
9377597570964258816Bammel and Rothstein (1975)
107580721483160132811489280McKay and Rogoyski (1995)
115363937773277371298119673540771840McKay and Wanless (2005)
121.62×10^(44)McKay and Rogoyski (1995)
132.51×10^(56)McKay and Rogoyski (1995)
142.33×10^(70)McKay and Rogoyski (1995)
151.5×10^(86)McKay and Rogoyski (1995)

Sudoku is a special case of a Latin square.

Greenhill et al. (2026) proved that a uniformly random Latin square of order n has every row an even permutation with probability 2^(-n+o(n)) as n->infty. Their stronger theorem prescribes which row, column, and symbol permutations are even or odd, subject to the necessary parity identity.

The fewest entries needed to specify a Latin square uniquely are studied using Latin square critical sets, minimal collections of entries with a unique completion.

A Latin square transversal contains exactly one cell from every row, column, and symbol class. A duplex contains exactly two cells from every row, column, and symbol class.

A coloring of a Latin square assigns colors to its cells so that cells sharing a row, column, or symbol have different colors. Its chromatic number is the least number of colors in such an assignment, equivalently the chromatic number of its Latin square graph. Shokri and Akbari (2026) proved that the Cayley table of the dihedral group D_n of order 2n has chromatic number 2n+2 when n>=3 is odd. This colors cells of the Cayley table, not vertices of a Cayley graph.

Let N(n) denote the maximum number of pairwise orthogonal Latin squares of order n. Rosin (2026) constructed four such squares of order 22 and six of order 74. Combined with previous constructions, these give N(n)>=4 for every integer n>10 and N(n)>=6 for every integer n>68. His 33 improved lower bounds are summarized below. These are existence bounds, not assertions of the exact values of N(n).

lower bound for N(n)orders n
422
660, 74
745, 50, 78, 85, 92, 98, 175, 183, 482
872, 90
954, 162, 192, 207, 225, 328, 335, 486
1080
1196, 324, 430, 442, 456, 469, 494
12427
14144
17288

Rosin (2026) reports that GPT-6 Astra found the constructions, which he checked computationally, and that Claude independently reconstructed and checked them from their descriptions.


See also

36 Officer Problem, Alon-Tarsi Conjecture, Euler Square, Kirkman Triple System, Lam's Problem, Latin Square Critical Set, Latin Square Graph, Partial Latin Square, Quasigroup, Rook Graph, SOMA, Sudoku

Explore with Wolfram|Alpha

References

Bammel, S. E. and Rothstein, J. "The Number of 9×9 Latin Squares." Disc. Math. 11, 93-95, 1975.Cayley, A. "On Latin Squares." Messenger Math. 19, 135-137, 1890.Colbourn, C. J. and Dinitz, J. H. (Eds.). CRC Handbook of Combinatorial Designs. Boca Raton, FL: CRC Press, 1996.Comtet, L. Advanced Combinatorics: The Art of Finite and Infinite Expansions, rev. enl. ed. Dordrecht, Netherlands: Reidel, p. 183, 1974.Euler, L. "Recherches sur une nouvelle esp ece de quarrès magiques." Verh. Zeeuwsch Gennot. Weten Vliss 9, 85-239, 1782.Frolov, M. "Sur les permutations carrés." J. de Math. spéc. 4, 8-11 and 25-30, 1890.Gessel, I. "Counting Latin Rectangles." Bull. Amer. Math. Soc. 16, 79-83, 1987.Greenhill, C.; Kopfová, L.; Kwan, M.; and Petrova, K. "On the Probability That a Random Latin Square Is All-Even." 9 Oct 2026. https://arxiv.org/abs/2610.13487.Hunter, J. A. H. and Madachy, J. S. Mathematical Diversions. New York: Dover, pp. 33-34, 1975.Kraitchik, M. "Latin Squares." §7.11 in Mathematical Recreations. New York: W. W. Norton, p. 178, 1942.Lindner, C. C. and Rodger, C. A. Design Theory. Boca Raton, FL: CRC Press, 1997.Linial, N. and Luria, Z. "An Upper Bound on the Number of High-Dimensional Permutations." Combinatorica 34, 471-486, 2014. https://doi.org/10.1007/s00493-011-2842-8.MacMahon, P. A. Combinatory Analysis, Vol. 1. London, England: Cambridge University Press, 1915.McKay, B. D. "Latin Squares." https://users.cecs.anu.edu.au/~bdm/data/latin.html.McKay, B. D. and Rogoyski, E. "Latin Squares of Order 10." Elec. J. Combin. 2, N3, 1995. https://doi.org/10.37236/1222.McKay, B. D. and Wanless, I. M. "On the Number of Latin Squares." Ann. Combin. 9, 335-344, 2005.Nechvatal, J. R. "Asymptotic Enumeration of Generalised Latin Rectangles." Util. Math. 20, 273-292, 1981.Norton, H. W. "The 7×7 Squares." Ann. Eugenics 9, 269-307, 1939.Rohl, J. S. Recursion via Pascal. Cambridge, England: Cambridge University Press, pp. 162-165, 1984.Rosin, C. D. "Improved Lower Bounds for Mutually Orthogonal Latin Squares (MOLS) at 33 Orders." 12 Nov 2026. https://arxiv.org/abs/2611.16299v1.Ryser, H. J. "Latin Rectangles." §3.3 in Combinatorial Mathematics. Buffalo, NY: Math. Assoc. Amer., pp. 35-37, 1963.Sade, A. "Enumération des carrés latins. Application au 7ème ordre. Conjectures pour les ordres supérieurs." 8 pp. Marseille, France: Privately published, 1948.Saxena, P. N. "A Simplified Method of Enumerating Latin Squares by MacMahon's Differential Operators; II. The 7×7 Latin Squares." J. Indian Soc. Agricultural Statist. 3, 24-79, 1951.Shao, J.-Y. and Wei, W.-D. "A Formula for the Number of Latin Squares." Disc. Math. 110, 293-296, 1992.Sloane, N. J. A. Sequences A000315/M3690, A000479, A002860/M2051, A040082, and A072377 in "The On-Line Encyclopedia of Integer Sequences."Shokri, K. and Akbari, M. "On the Chromatic Number of Cayley Tables of Dihedral Groups." 9 Nov 2026. https://arxiv.org/abs/2611.13274v1.Tarry, G. "Le problème de 36 officiers." Compte Rendu de l'Assoc. Français Avanc. Sci. Naturel 1, 122-123, 1900.Tarry, G. "Le problème de 36 officiers." Compte Rendu de l'Assoc. Français Avanc. Sci. Naturel 2, 170-203, 1901.Wells, M. B. "The Number of Latin Squares of Order Eight." J. Combin. Th. 3, 98-99, 1967.

Referenced on Wolfram|Alpha

Latin Square

Cite this as:

Weisstein, Eric W. "Latin Square." From MathWorld--A Wolfram Resource. https://mathworld.wolfram.com/LatinSquare.html

Subject classifications