15
$\begingroup$

How many ways is there to color an $n\times n$ square grid with $n$ colors such that each column and each row contains exactly one $1\times 1$ square of each color?

And how many ways if the same is required of the two diagonals?

  • 5
    http://en.wikipedia.org/wiki/Latin_square#Number2011-12-19
  • 5
    The first part of your Question asks about the number of latin squares of order n, which is [this entry in OEIS](http://oeis.org/A002860). I don't know how the counts are reduced if one or both diagonals are also required to be permutations of the n colors (or symbols, to use the more conventional term).2011-12-19
  • 7
    According to Handbook of Combinatorial Designs, Volume 10 by C. J. Colbourn, Jeffrey H. Dinitz, Sec. 1.10, the term for latin squares whose diagonals are also permutations (transversals, since these have one each of the rows and columns) is "diagonal latin square". Other authors use the term "double diagonal latin square" to emphasize the restriction for both main diagonal and anti-diagonal.2011-12-19

2 Answers 2