Placing Dominoes On A Chequerboard
APL (Dyalog Extended), 61 bytes



{+/∊{(∪≡⊢)¨(,2,/m)[M],.,⍉C[M←⍵⌂cmat≢C]}¨0,⍳≢C←,2,⌿⊢m←⍵⊥¨⍳,⍨⍵}


Try it online!

Finally got how to circumvent the funky inner assignment on Extended ;-)

The difference with the one below is that dfns is auto-loaded under ⌂, and a no-op is added after assignment into m.

I have a 68-byte Unicode and 60-byte Extended solution by rewriting from scratch; it is left as an exercise for the reader.





APL (Dyalog Unicode), 72 69 bytes



⎕CY'dfns'
{+/∊{(∪≡⊢)¨(,2,/m)[M],.,⍉C[M←⍵cmat≢C]}¨0,⍳≢C←,2,⌿m←⍵⊥¨⍳,⍨⍵}


Try it online!

Non-recursive brute force. This works the other way around: generate all possible horizontal/vertical domino placements, generate all possible combinations of n horizontal and n vertical placements, and count the ones that don't have any duplicated cells.

Ungolfed with comments

⎕CY'dfns'  ⍝ Load dfns library to access function "cmat"

f←{  ⍝ Main function; ⍵←1-based index n (does not handle 0)

  m←⍵⊥¨⍳,⍨⍵  ⍝ n-by-n matrix of unique integers
        ,⍨⍵  ⍝ [n n]
       ⍳     ⍝ Nested matrix having [1..n;1..n]
    ⍵⊥¨      ⍝ Compute n×i+j for each cell containing [i j]

  R←,2,/m  ⍝ Horizontal domino placements
     2,/m  ⍝ From the matrix m, pair horizontally consecutive cells
    ,      ⍝ Flatten the outermost layer to make it a nested vector
  C←,2,⌿m  ⍝ Vertical domino placements, using ⌿ instead of /

  +/(0,⍳≢R){M←⍺cmat⍵⋄+/(∪≡⊢)¨,R[M],.,⍉C[M]}¨≢R  ⍝ Count the placements
    (0,⍳≢R){                              }¨≢R  ⍝ For each ⍺←0..length(≢) of R with ⍵←R,
            M←⍺cmat⍵                        ⍝ Generate all combinations to use for R and C
                    ⋄        ,R[M],.,⍉C[M]  ⍝ Concatenate all combinations of R with all combinations of C
                     +/(∪≡⊢)¨  ⍝ Count the ones whose cell values are all unique
  +/  ⍝ Sum all the counts
}