# Create a 4-by-4 regular square

We can say that an $n$-by-$n$ square is regular provided that:

1. Each of the integers from $0$ to $n^2 − 1$ appears in exactly one cell, and each cell contains only one integer (so that the square is filled), and

2. If we express the entries in base-$n$ form, each base-$n$ digit occurs exactly once in the units’ position, and exactly once in the $n$’s position.

Example with 3-by-3 regular square:

The square is regular because each of the ternary digits $0$, $1$, and $2$ appears exactly once in the units’ and $3$’s position in each row and each column.

Can someone help me construct an example of a 4-by-4 regular square, showing my answer in both decimal and base-$4$ notations.

$\begin{pmatrix} 00 & 23 & 32 & 11 \\ 21 & 02 & 13 & 30 \\ 12 & 31 & 20 & 03 \\ 33 & 10 & 01 & 22 \end{pmatrix} = \begin{pmatrix} 0 & 11 & 14 & 5 \\ 9 & 2 & 7 & 12 \\ 6 & 13 & 8 & 3 \\ 15 & 4 & 1 & 10 \end{pmatrix}$