Embees: Zero-sum square arrays with modular arithmetic.
Version of Sunday 15 January 2020.
Dave Barber's other pages.

§1. An embee is a square array of nonnegative integers:

The pronunciation of "𝕄𝔹" is what yields the name embee.

Any row, column, superior, or inferior is termed a straight.

The embee Z, all of whose elements are zero, exists for all 𝕄 and 𝔹.

In this report, embees will usually have names like E, F, and G. The modulus of E can be written E𝕄; the breadth E𝔹.

It is obvious what the rows and columns of a square array would be, but an example will shed light on what the two kinds of diagonals are. Given embee E, with 𝔹 = 4 and 𝕄 = any value:

E
E00E01 E02E03
E10E11 E12E13
E20E21 E22E23
E30E31 E32E33

The four superior diagonals are:

and the four inferior diagonals are:

The number of superiors is always equal to the breadth, as is the number of inferiors.

Although the names superior and inferior are not particularly descriptive, no better term has been found.


§2. Two embees are equivalent to each other if they have the same breadth and modulus, and if they are related directly or indirectly by any sequence of the equivalence transformations displayed in this section. A notation for equivalence is EF.

The transformations are best explained with examples, as follows. Given embee E as before:

E
E00E01 E02E03
E10E11 E12E13
E20E21 E22E23
E30E31 E32E33

There are four mirror operations:

mirror_row (E)
E30E31 E32E33
E20E21 E22E23
E10E11 E12E13
E00E01 E02E03
mirror_col (E)
E03E02 E01E00
E13E12 E11E10
E23E22 E21E20
E33E32 E31E30
mirror_sup (E)
E00E10 E20E30
E01E11 E21E31
E02E12 E22E32
E03E13 E23E33
mirror_inf (E)
E33E23 E13E03
E32E22 E12E02
E31E21 E11E01
E30E20 E10E00

There is an operation that rotates the embee by a multiple of ninety degrees. The numerical argument can be any integer, which will be interpreted in modulo 4. An argument of 0 gives the identity operation. Shown as examples are +1, +2, and +3:

rotate (E, +1)
E30E20 E10E00
E31E21 E11E01
E32E22 E12E02
E33E23 E13E03
rotate (E, +2)
E33E32 E31E30
E23E22 E21E20
E13E12 E11E10
E03E02 E01E00
rotate (E, +3)
E03E13 E23E33
E02E12 E22E32
E01E11 E21E31
E00E10 E20E30

There are two shift operations, where the numerical argument can be any integer. Shown for example is +1:

shift_rows (E, +1)
E30E31 E32E33
E00E01 E02E03
E10E11 E12E13
E20E21 E22E23
shift_cols (E, +1)
E03E00 E01E02
E13E10 E11E12
E23E20 E21E22
E33E30 E31E32

With embees E, F, and G, it is easy to show that:

In many cases, there is more than one way to write an equivalence. For instance,

rotate (shift_rows (E, +1), +1) = shift_cols (rotate (E, +1), −1).

If two embees differ in breadth or modulus or both, equivalence is not defined.


§3. Two embees of the same breadth and the same modulus may be lexicographically compared. The manner of applying this to embees is unsurprising, and employs the row-major ordering used for storing two-dimensional arrays in many computer environments. Here is an example with embees E and F:

If there is no difference between the respective first rows, the second rows are compared, and then the third and so forth. If all corresponding elements are equal, then E = F.

If two embees differ in breadth or modulus or both, no equality or inequalies are defined.


§4. The equivalences of §2 combined with the lexicographical ordering of §3 allows us to establish canonical forms for embees. The principle is that if EF and E < F, then F is NOT in a canonical form. Every embee does have a unique canonical form.

As an example, below is an ordinary embee (𝕄 = 8) in canonical form. The numbers have been subscripted to make it easier to see how the elements move around under equivalence tranformations.

1aw2ax2ay3az
4bw5bx3by4bz
6cw5cx7cy6cz
5dw4dx4dy3dz

Next are four non-canonical embees equivalent to the one above:

4bw5bx3by4bz
1aw2ax2ay3az
5dw4dx4dy3dz
6cw5cx7cy6cz
3dz4dy4dx5dw
3az2ay2ax1aw
4bz3by5bx4bw
6cz7cy5cx6cw
2ax5bx5cx4dx
2ay3by7cy4dy
3az4bz6cz3dz
1aw4bw6cw5dw
4dy7cy3by2ay
4dx5cx5bx2ax
5dw6cw4bw1aw
3dz6cz4bz3az


§5. The census of an embee is simply a listing of how many elements are of each value. If two embees are equivalent, they have the same census. As an example, each of the embees within this section has 2 zeroes, 4, ones, 3 twos, 3 threes, and 4 fours. Hence its census is (2, 4, 3, 3, 4).

Note that two embees with the same census might not be equivalent. Examples are the four embees below, with 𝕄 = 4 and 𝔹 = 4. All have the census (4, 4, 4, 4), and are all canonical forms. Because they are distinct canonical forms, however, they cannot be equivalent.

0000
1313
2222
1313
0013
0211
2231
2033
0103
2321
0103
2321
0121
2303
0121
2303


§6. Here are some operations that preserve embeeness, and can be categorized by their preservation (or not) of modulus and breadth. All arithmetic on elements is, of course, modular.

§6A. Output 𝕄 = input 𝕄, and output 𝔹 = input 𝔹:

G = −E is formed by negating every element of E. Of course, −Z = Z.
G = E + F is formed by adding corresponding elements of E and F.

As expected, EF = E + (−F).

Z is the identity augend, addend and subtrahend; but not minuend.

If n is any integer, then G = E × n = n × E is formed by multiplying every element of E by n. Here is an example, where G = E × 3:

E, with E𝕄 = 8
1223
4534
6576
5443
G, with G𝕄 = 8
3661
4714
2752
7441

§6B. Output 𝔹 = input 𝔹:

If n is any nonzero integer, then G = E ×× n = n ×× E is formed by multiplying E𝕄 by the absolute value of n to obtain G𝕄, and then multiplying every element of E by n. Here is an example, where G = E ×× 3:

E, where E𝕄 = 8
1223
4534
6576
5443
G, where G𝕄 = 24
3 6 6 9
1215 912
18152118
151212 9

With this operation, there is no modular reassessment.

With embee E, if n is an integer that meets three requirements:
  • n is greater than 1;
  • n is less than E𝕄
  • n is a factor of E𝕄
then G = E ÷ n is formed by dividing E𝕄 by the absolute value of n to form G𝕄, and then reassessing the elements of E by the new modulus. Note that the elements themselves are not divided by anything. Here are examples, with G = E ÷ 2 and H = E ÷ 3:

E, where E𝕄 = 6
0543
2514
2004
2211
G, where G𝕄 = 3
0210
2211
2001
2211
H, where H𝕄 = 2
0101
0110
0000
0011

§6C. Output 𝕄 = input 𝕄:

G = repeat (E, n) fills G with copies of E. In the following example, G = repeat (E, 2), and E𝕄 = G𝕄 = 8:

E, where E𝔹 = 4
1223
4534
6576
5443
G, where G𝔹 = 8
12231223
45344534
65766576
54435443
12231223
45344534
65766576
54435443

No modular reassessment is necessary.

With G = expand (E, n), each element of E appears once in G, separated by n − 1 rows and columns of zeroes. In the following example, G = expand (E, 2), and E𝕄 = G𝕄 = 8:

E, where E𝔹 = 4
1223
4534
6576
5443
G, where G𝔹 = 8
10202030
00000000
40503040
00000000
60507060
00000000
50404030
00000000

No modular reassessment is necessary.


§7. For selected combinations of breadth and modulus, the table below displays the quantity of all embees, and the the quantity of embees in canonical form. The breadth of four receives an appendix because its quantities are both interesting and manageable to calculate.

embee quantities 𝕄 = 2 𝕄 = 3 𝕄 = 4 𝕄 = 5 𝕄 = 6 𝕄 = 7 𝕄 = 8 𝕄 = 9
𝔹 = 2 all 2 1 2 1 2 1 2 1
canon 2 1 2 1 2 1 2 1
𝔹 = 3 all 1 27
= 33
1 1 27
= 33
1 1 27
= 33
canon 1 5 1 1 5 1 1 5
𝔹 = 4 all 128
= 27
81
= 34
4,096
= 212
625
= 54
10,368
= 27·34
2,401
= 74
65,536
= 216
6,561
= 38
canon 13 6 111 21 181 55 862 120
𝔹 = 5 all 256
= 28
6,561
= 38
65,536
= 216
48,828,125
= 511
canon 7 57 400 246,210
𝔹 = 6 all 131,072
= 217
canon 772
𝔹 = 7 all 16,777,216
= 224
canon 43,624
 
appendix 𝕄 = 10 𝕄 = 11 𝕄 = 12 𝕄 = 13 𝕄 = 14 𝕄 = 15 𝕄 = 16 𝕄 = 17
𝔹 = 4 all 80,000
= 27·54
14,641
= 114
331,776
= 212·34
28,561
= 134
307,328
= 27·74
50,625
= 34·54
1,048,576
= 220
83,521
= 174
canon 963 231 3,517 406 3,199 666 10,140 1,035

The numbers came from a computer program that did a brute-force search. The general formula is not yet known, although some patterns are beginning to emerge, particularly when the modulus is a prime number.


§8. All the embees discussed so far are two-dimensional (𝔻 = 2). The investigation can be extended to higher dimensionalities, although that is not attempted in this report.

The number of straights (𝕊) grows very quickly, with the following general formula:

𝕊 = 𝔹𝔻 − 1 × (3𝔻 − 1) ÷ 2

Note that 𝕊 is independent of the modulus. Here is a table with selected values:

𝕊 𝔹 = 2 𝔹 = 3 𝔹 = 4 𝔹 = 5
𝔻 = 2 8 12 16 20
𝔻 = 3 52 117 208 325
𝔻 = 4 320 1,080 2,560 5,000
𝔻 = 5 1,936 9,801 30,976 75,625

An example is worthwhile. For the case 𝔻 = 3, 𝕄 = 4, and 𝔹 = 4, here are the thirteen straights that pass through (0, 0, 0):

The criterion of "perpendicular to n edges" generalizes to straights of higher dimensionality, and is useful for organizing them.