4-by-4 regular square in decimal and base-4

117 Views Asked by At

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:

enter image description here

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.