Enumeration of Latin Squares and Rectangles

Author's note: This is currently a snippet from my PhD thesis On the number of Latin rectangles and the paper The many formulae for the number of Latin rectangles. I can be contacted by email: douglas.stones (at) sci.monash.edu.au

- Douglas S. Stones

Introduction
A $$k \times n$$ Latin rectangle is a $$k \times n$$ array $$L=(l_{ij})$$ of $$n$$ symbols such that each symbol occurs exactly once in each row and at most once in each column. If $$k=n$$ then $$L$$ is called a Latin square. A Latin rectangle on the symbols $$\mathbb{Z}_n$$ is called normalised if the first row is $$(0,1, \dots, n-1)$$ and called reduced if the first row is $$(0,1, \dots, n-1)$$ and the first column is $$(0,1, \dots ,k-1)^T$$. Let $$L_{k,n}$$ denote the number of $$k \times n$$ Latin rectangles, $$K_{k,n}$$ denote the number of $$k \times n$$ normalised Latin rectangles and let $$R_{k,n}$$ denote the number of reduced $$k \times n$$ Latin rectangles.. The total number of $$k \times n$$ Latin rectangles is $$L_{k,n}=n! K_{k,n} = \frac{n! (n-1)!} {(n-k)!} R_{k,n}$$. In the case of Latin squares, the numbers $$L_{n,n}$$, $$K_{n,n}$$ and $$R_{n,n}$$ shall be denoted $$L_n$$, $$K_n$$ and $$R_n$$ respectively.

The values of $$R_{k,n}$$ for $$1 \leq k \leq n \leq 11$$ were given by McKay and Wanless, which we reproduce below. We omit $$R_{1,n}=1$$. Sloane's A002860 lists $$K_n$$.

The enumeration of $$R_n$$ has a history stretching back to Euler, Cayley and MacMahon. A survey is provided by McKay, Meynert and Myrvold. An upper bound on $$R_n$$ are obtained through the study of permanents. A lower bound on $$R_n$$ is given by van Lint and Wilson. Estimates for the number of Latin squares were given by McKay and Rogoyski, Zhang and Ma and Kuznetsov.

A survey of the enumeration of Latin rectangles was given by Stones and Wanless. An asymptotic formula for the number of $$k \times n$$ Latin rectangles was given by Goldsil and McKay as $$n \rightarrow \infty$$ with $$k=o(n^{6/7})$$. The value of $$K_{2,n}$$, $$K_{3,n}$$ and $$K_{4,n}$$ is given by Sloane's A000166, A000186 and A000573 , respectively.

Bailey and Cameron (see also the CRC Handbook ) discuss combinatorial objects equivalent to Latin squares. Wikipedia host a list of problems in the theory of Latin squares.

The number $$D_n$$ of derangements is related to the number of $$2 \times n$$ Latin rectangles by $$D_n = n! \sum_{i=0}^n \frac{(-1)^i}{i!} = K_{2,n} = (n-1) R_{2,n} .$$ Riordan gave the credit to Yamamoto for the equation $$R_{3,n}= \sum_{i+j+k=n} n (n-3)! (-1)^j \frac{2^k i!}{k!} {{3i+j+2} \choose {j}} .$$

Let $$p$$ be a prime. Stones and Wanless showed that if $$k \leq n$$ and $$p \geq k$$ then $$R_{k,n+p}$$ is divisible by $$p$$ if and only if $$R_{k,n}$$ is divisible by $$p$$. For example, in the following table we can see that $$R_{4,n}$$ is indivisible by $$5$$ for all $$n \geq 4$$. Furthermore, if $$p<k$$ then $$p^{\left\lfloor (n-k)/p \right\rfloor}$$ divides $$R_{k,n}$$. We will inspect the divisors of $$R_{4,n}$$, $$R_{5,n}$$ and $$R_{6,n}$$ in the following sections.

Four-line Latin rectangles
A formula for the number of reduced $$4 \times n$$ Latin rectangles is given by Doyle, from which the following table of values of $$R_{4,n}$$ was calculated. The c code used has been uploaded to Google Code along with code for $$R_{5,n}$$ and $$R_{6,n}$$. We use $$p_m$$ to denote an $$m$$-digit prime number and $$c_m$$ to denote an $$m$$-digit composite number. Factorisations were performed using Dario Alpern's applet. Other formulae for the number of four-line Latin rectangles are given by Light Jr., Athreya, Pranesachar and Singhi (see also Pranesachar ) and Gessel. A similar claim is made by de Gennaro.

Five-line Latin rectangles
Doyle's method can be adapted to also find $$R_{5,n}$$, from which the following table was calculated.

Six-line Latin rectangles
Doyle's method can be adapted to also find $$R_{6,n}$$, from which the following table was calculated.