MOLS {blocksdesign}R Documentation

Prime power MOLS from finite fields


Constructs r sets of mutually orthogonal Latin squares (MOLS) of dimension p**q for prime p and integer power q where r < p**q. Memory issues mean that the maximum size of the exponent q for specific p is restricted to the values shown in the table below:

prime p maximum q
2 13
3 8
5 6
7 5
11 4
13 17 19 23 3
29 31 37 41 43 47 53 59 61 67 71 73 79 83 89 97 2
Any prime >97 1


MOLS(p, q, r = 1)



is any suitable integer base


is any suitable integer exponent


is any suitable number of squares


Generates MOLS by cyclic permutation of a basic Latin square constructed from a vector of ordered elements of a prime-power finite field of size p**q (see Chapter 1 of Raghavarao 1971).

The primitive polynomials for the MOLS generated by this package were extracted from the Table of Primitive Polynomials given in the Supplement to Hansen and Mullen (1992).

The output is a single data frame of size p**q x (r+2) for the required set of MOLS with a column for the rows classification, a column for the columns classification and separate columns for each treatment set of the required set of squares.

Also see the function GraecoLatin which will generate pairs of MOLS for a range of non-prime power design sizes v**2 including all odd values of v and any even valued v <= 30 except for 6 or 2.


Data frame of factor levels for rows, columns and treatment sets


Hansen, T. & Mullen, G. L. (1992) Primitive polynomials over finite fields, Mathematics of Computation, 59, 639-643 and Supplement.

Raghavarao D. (1971) Constructions and Combinatorial Problems in Design of Experiments, Dover Publications, Inc. Section 1.3

See Also



MOLS(2,3,7) # Seven MOLS of size 8 x 8
MOLS(3,2,4) # Four MOLS of size 9 x 9
MOLS(3,3,4) # Four MOLS of size 27 x 27
MOLS(23,2,2) # Two MOLS of size 529 x 529

[Package blocksdesign version 4.9 Index]