On the structure of additive systems of integers

A sum-and-distance system is a collection of finite sets of integers such that the sums and differences formed by taking one element from each set generate a prescribed arithmetic progression. Such systems, with two component sets, arise naturally in the study of matrices with symmetry properties and consecutive integer entries. Sum systems are an analogous concept where only sums of elements are considered. We establish a bijection between sum systems and sum-and-distance systems of corresponding size, and show that sum systems are equivalent to principal reversible cuboids, which are tensors with integer entries and a symmetry of"reversible square"type. We prove a structure theorem for principal reversible cuboids, which gives rise to an explicit construction formula for all sum systems in terms of joint ordered factorisations of their component set cardinalities.


Introduction
The present paper concerns the relationship between sum-and-distance systems and sum systems, and their general structure, including a construction method for all such systems. Roughly speaking, a sum-and-distance system consists of several component sets of natural numbers such that the sums comprising one element, or its negative, of each set generate a prescribed target set, specifically an arithmetic progression. More simply, a sum system consists of several sets of nonnegative integers such that the sums formed by choosing exactly one term from each set generate a sequence of consecutive integers. For the precise definitions, see Section 2 below.
Two-component sum-and-distance systems arise naturally when we consider square arrays of consecutive integers with certain symmetry properties. The algebraic properties of square matrices with different types of symmetries were recently explored in [5], also giving construction formulae for the various types. In that paper, the matrix entries were assumed to be general real numbers, allowing the symmetry classes to form direct summands in a Z 2 -graduation of the matrix algebra over R. However, an additional level of complication is introduced when we require the matrix entries to be integers or, more specifically, a consecutive sequence of integers, such as in a magic square or a principal reversible square [8].
A reversible square M is an n × n matrix with the properties of column and line reversal symmetry (R) and the vertex sum property (V) (see [5] and equations (10), (5) in Section 4 below). Such a matrix also has the associated symmetry that any two entries in diametrically opposite positions with respect to the centre of the matrix add up to the same constant 2w (see [5], Lemma 7.1). Subtracting w from each matrix entry, we obtain a reversible square M 0 whose entries sum up to 0. If n = 2ν is even, it is then of the form ( [5] Theorem 7.2) where 1 ν ∈ R ν is the vector with all entries equal to 1, J ∈ R ν×ν is the matrix which has entries 1 on the anti-diagonal and 0 elsewhere, and a, b ∈ R ν are arbitrary vectors. If the reversible square M is to contain exactly the integers 1, . . . , n 2 , then the weight w can be found as the average of all entries, w = (n 2 + 1)/2; hence the weightless reversible square M 0 will have as entries the numbers − n 2 − 1 2 , − n 2 − 1 2 + 1, . . . , Considering that multiplication by J on the left or right just inverts the order of the rows or columns of a matrix, respectively, we find from (1) that the sums ±a j ± b k , with j, k ∈ {1, . . . , ν} and independently chosen signs, must generate each odd number from −n 2 + 1 to n 2 − 1 exactly once. In other words, the sets of entries of the vectors a and b form a two-component non-inclusive sum-and-distance system as defined in Section 2 below. If n = 2ν + 1 is odd, then the weightless reversible square M 0 will have the form ([5] Theorem 7.2) with vectors a, b ∈ R ν , and by the same reasoning as above, we find that, for the reversible square M to contain the integers 1, . . . , n 2 , the sums ±a j ± b k , where j, k ∈ {1, . . . , ν} and the signs are chosen independently, taken together with the entries ±a j , ±b j (j ∈ {1, . . . , ν}), must generate exactly the integers 1, 2, . . . , (n 2 − 1)/2 and their negatives. In other words, the sets of entries of the vectors a and b form a two-component inclusive sum-and-distance system, as defined in Section 2 below. Similarly, sum-and-distance systems appear in a certain type of rank 3 associated magic squares (cf. [2] Theorem 9). As shown in Lemma 3.1 and Theorem 4.1 of [5] (see also [2] Theorem 1), a 2ν × 2ν matrix M will have all rows and columns adding up to the same number, and also the associated symmetry described above, if, after subtracting the weight w, it has the form with matrices V, W ∈ R ν×ν whose rows add up to 0. Specifically, if ν is even and we choose vectors v, w with entries ±1 which, for each vector, add up to 0, and further vectors a, b ∈ R ν , and set V = a v T , W = b w T , then the resulting matrix M (after adding the weight w = (n 2 + 1)/2) will be an associated magic square with entries 1, . . . , n 2 if and only if the sets of entries of a and b form a two-component non-inclusive sum-and-distance system. As a final example, we mention most perfect squares; these are square matrices of even dimensions which, in addition to having all rows and columns adding up to the same number, have the properties that all 2 × 2 submatrices have the same sum of entries, and that all pairs of entries half the matrix size apart on any diagonal add up to the same number. By [5] Theorem 6.2 any 2ν × 2ν most perfect square, with even ν, is, after subtracting the weight from each entry, of the form where a, b ∈ R ν are any vectors and § ν = (1, −1, 1, −1, . . . , 1, −1) T ∈ R ν . Again we see that M will have entries 1, . . . , (2ν) 2 if and only if the sets of entries of the vectors 2a and 2b form a two-component non-inclusive sum-and-distance system. Sum systems are conceptually simpler. They are directly related to reversible cuboids, the multidimensional analogues of reversible squares and rectangles, as shown in Theorem 4 below.
Further, it is one of the results of the present study that sum systems are in one-to-one correspondence with sum-and-distance systems (Theorems 2, 3).
We remark that sum systems can be interpreted as discrete local coordinate systems for a set of consecutive integers, generalising the base q decimal representation. Indeed, the integers 0, 1, . . . , q m − 1 can be uniquely represented in the form where a j ∈ {0, 1, . . . , q − 1}, so the sets form an m-component sum system in the sense defined in Section 2 below. Using this system as a basis, the m entries, one taken from each component set, which add up to a given number can be considered as that number's discrete coordinates. In general, sum systems will have a considerably more complicated structure than the above simple arithmetic progressions, and it is one of the main results of the present paper to provide a constructive description of the general sum system (see Theorem 9).
Research on some related topics has been undertaken previously, including the study of arithmetic progressions arising in the sum of two sets of integers [1], [4]; comparing the sizes of the sum set and the difference set of a set with itself [6], [9], [7]; for an overview of this subject, see [3]. However, it seems that despite the simplicity of the concepts, sum systems and sum-and-distance systems, as studied here, have not attracted much attention in the mathematical literature, and our present results are new.
The paper is organised as follows. After giving the definitions of sum-and-distance systems and sum systems in Section 2, we use a polynomial factorisation method to show in Section 3 that there is a one-to-one relationship between sum-and-distance systems and sum systems of suitable size. It is fairly straightforward to see that a sum-and-distance system generates a corresponding sum system, but the fact that every sum system arises in this way is not obvious. In Section 4, we explore the connection between m-component sum systems and m-dimensional principal reversible cuboids, which are generalisations of Ollerenshaw and Brée's principal reversible squares [8] from square matrices to more general order m tensors. This shows that the structure of sum systems (and hence, by means of the bijection, of sum-and-distance systems) can be fully understood in terms of the construction of principal reversible cuboids. In Section 5, we establish that the structure of the latter is essentially recursive, in the sense that any principal reversible cuboid arises from glueing offset copies of a maximal principal reversible subcuboid together. Finally, in Section 6 we show that, due to this recursive property, every principal reversible cuboid can be constructed by means of a chain of building operators with parameters arising from a joint ordered factorisation of the cuboid's dimensions, thus linking the structure of principal reversible cuboids with number theoretic properties of their sizes. As a result, we obtain the general structure of the component sets of sum systems as nested arithmetic progressions. We conclude with some examples which illustrate how sum systems and sum-and-distance systems arise from joint ordered factorisations.

Definition of sum-and-distance systems and sum systems
Arithmetic progressions play a central role in the present paper. We use the notation m := {0, 1, . . . , m − 1} for any m ∈ N, so the arithmetic progression with start value a, step size s and N terms can be expressed as s N + a (= {a, a + s, a + 2s, . . . , a + (N − 1)s}).
Note that we use the standard convention that A + B = {x + y : x ∈ A, y ∈ B} and aA + b = {ax + b : x ∈ A} for sets A, B ⊂ R and a, b ∈ R throughout. As usual, A − B = A + (−B). We write |M | for the cardinality of a finite set M.
The set of pairs is called an inclusive sum-and-distance system if The target set for a non-inclusive sum-and-distance system, 2 2νµ + 1 = {1, 3, 5, . . . , 4νµ − 1}, differs from that for an inclusive sum-and-distance system, 2νµ+ν+µ +1 = {1, 2, . . . , 2νµ+ν+µ}, in that the former only has odd integers; this difference is motivated by the situations outlined above in which sum-and-distance systems arise, and the reason for it will be made transparent by Theorems 2, 3.
Sum-and-distance systems can be equivalently characterised by a target set of positive and negative numbers in the following way.
(a) These sets form a non-inclusive sum-and-distance system if and only if where the signs ± are chosen independently, so there are 4 elements of the set for each pair (j, k).
(b) These sets form an inclusive sum-and-distance system if and only if where the signs ± are chosen independently, so there are 8 elements of the set for each pair (j, k).
Proof. (a) The sums ±a j ± b k will give exactly the sums and absolute distances |a j ± b k | and their negatives −|a j ± b k |, so the resulting set will be the union of the target set of the non-inclusive sum-and-distance system with its negative; this can be written as the step-2 arithmetic progression on the right-hand side.
(b) The sums ±a j ± b k give the same results as in (a), and including the elements ±a j and ±b k , we obtain the union of the target set of the inclusive sum-and-distance system with its negative. By adding the element 0 to the set, we can complete this to the arithmetic progression on the right-hand side.
The above lemma motivates the following generalisation.

We call a pair of sets
i.e. in explicit form, More generally, we call a collection of m sets A 1 , A 2 , . . . , A m ⊂ N 0 , each of cardinality at least 2, an m-part sum system if Since the number 0 in the target set can only arise as a sum of 0s, as all numbers in the sets are non-negative, it follows that each component set of a sum system contains the number 0.

Correspondence between sum-and-distance systems and sum systems
Given a finite set M ⊂ N 0 , we can associate with it the polynomial More generally, for a finite set M ∈ Z, we have an associated Laurent polynomial (2) which may include negative powers. Specifically for the arithmetic progression M = s N + a, where s, N ∈ N and a ∈ N 0 , we find Clearly this polynomial has root 0 with multiplicity a; it is also evident that 1 is not a root, nor are the other sth roots of unity. Hence, to find the further roots of this polynomial, we may assume x s = 1 and observe that which shows that the non-zero roots of p s N +a are exactly the (sN )th roots of unity which are not sth roots of unity; in particular, they all lie on the complex unit circle.
The results of this section will rely on the following key observation.

Lemma 2.
Let p be a polynomial with real coefficients and with all its roots situated on the complex unit circle.
(a) If all roots of p are non-real, then p is palindromic and of even degree.
(b) If all roots of p are non-real except for the simple root −1, then p is palindromic and of odd degree.
Proof. (a) As the polynomial has real coefficients, its (non-real) roots come in complex conjugate pairs, say {r j , r j | j ∈ {1, . . . , m}}. Thus with 2m the degree of the polynomial, so p is palindromic.
(b) The polynomial p can be factorised as p(x) = (x + 1)p(x), wherep only has non-real roots situated on the unit circle. Writing where d is the degree of the polynomial p, a straightforward calculation gives and hence it follows by recursion thatα j ∈ R (j ∈ {0, . . . , d − 1}), since p has real coefficients. Therefore we can apply part (a) to find thatp is palindromic of even degree, i.e.α j =α d−1−j (j ∈ {0, . . . , d − 1}). Hence p is of odd degree, and we deduce from (3) that so p is palindromic.
Using this result, we can show that the component sets of sum systems always have a palindromic structure, too, in the following sense.
Theorem 1. Let m ∈ N. Suppose the sets A 1 , A 2 , . . . , A m ⊂ N 0 form an m-part sum system. Then, for each j ∈ {1, . . . , m}, Moreover, if all component sets A j have odd cardinality, then max A j is even for every j ∈ {1, . . . , m}; if at least one component set has even cardinality, then max A j is odd for exactly one j ∈ {1, . . . , m}.
Proof. Denoting the elements of the set A j by a where we used the sum system property m k=1 A k = d in the penultimate step. This shows that the polynomials p Aj form a factorisation of the polynomial on the right-hand side of (4). Now we distinguish between two cases.
if all d j are odd, then the polynomial on the right-hand side of (4) has no real roots; its roots are the non-real dth roots of unity. Hence, for any j ∈ {1, . . . , m}, p Aj has only non-real roots situated on the complex unit circle, and it has real coefficients (in fact, coefficients in {0, 1}). Hence, by Lemma 2 (a), p Aj has even degree and is palindromic, which gives the stated property for A j .
2nd case. If at least one of the component set cardinalities d j is even, then d is even, so −1 is a (simple) root of the polynomial on the right-hand side of (4). Therefore exactly one of the polynomials p Aj has the root −1; w.l.o.g. we may assume that p A1 is this polynomial. Then for any j ∈ {2, . . . , m}, the same reasoning as in the first case shows that p Aj has even degree and is palindromic, while, by Lemma 2 (b), p A1 is palindromic of odd degree.
This observation allows us to establish the following bijection between sum-and-distance systems and sum systems.
Proof. We find for the set sum as the sum of the largest elements of the component sets of a sum-and-distance system gives the largest element of its target set.
Proof. In analogy to the proof of Theorem 2, we find the set sum For the converse, we use the fact that for each j ∈ {1, . . . , m}, the component setÃ j of the sum system has palindromic symmetry by Theorem 1, which gives (bearing in mind that α 1 = 0), and in particular 2α νj +1 = α 2νj +1 . Thus α 2νj +1 = maxÃ j is even, which also follows from Theorem 1, as all component sets of the sum system have odd cardinality. Hence proving the claim.
Remark. Note that sum systems with odd cardinality throughout correspond to inclusive sum-and-distance systems, and the tight target set (containing consecutive integers) of the latter is related to the fact that the maximum of each component set of the sum system is even, as apparent from the proof of Theorem 3. However, sum systems with even cardinality do not have this property, and hence their corresponding non-inclusive sum-and-distance systems have a more sparse target set containing consecutive odd integers only. Thus the discrepancy between inclusive and non-inclusive sum-and-distance systems resolves into the simple dichotomy between odd and even cardinality of the component sets when considering the sum systems.
We remark further that at the level of sum systems, there is no reason to require that the components have all odd or all even cardinality. A sum system with mixed parity will, by the transforms given in Theorems 2 and 3, correspond to a hybrid inclusive/non-inclusive sum-anddistance system, but we do not pursue this correspondence further in the present study.

Principal reversible cuboids and sum systems
In this section we shall extend the definition of reversible square matrices, which can be considered as order 2 tensors, to general order m tensors. We use multiindex notation, i.e. tensor components are indexed by coordinate vectors k ∈ N m , which have a partial ordering given by The root element of the tensor (corresponding to the top left entry of a matrix) has index 1 m = (1, 1, . . . , 1) ∈ N m . We shall also use the standard unit vectors e j ∈ N m (j ∈ {1, . . . , m}), where (e j ) l = δ jl (j, l ∈ {1, . . . , m}), i.e. e j has jth entry 1 and all other entries 0.
Definition. Let m ∈ N and n ∈ N m . Then M ∈ N n 0 is called an order m tensor (of dimensions n 1 , n 2 , . . . , n m ). It has entries M k = M k1,k2,...,km ∈ N 0 (k ∈ N m , k ≤ n).
For j < m, we call any subtensor where m − j indices are fixed while the remaining j indices vary in the range determined by n an order j slice of M.
Remark. Strictly speaking, the order of the tensor is |{j ∈ {1, . . . , m} : n j > 1}| ≤ m, so it has order at most m. The order will be exactly m if n ∈ (N + 1) m . However, we allow n ∈ N m for ease of reference later.
The following is an extension of the vertex-cross sum property (V) of matrices which states that the two pairs of diagonally opposite corners of any rectangular submatrix add up to the same number [5].
This means that overall the set of entries of M is equal to the sum set of the sets of entries on each coordinate axis, where all but one entry of the index vector are kept equal to 1. This gives the following connection with sum systems. Then the sets A 1 , A 2 , . . . , A m ⊂ N 0 , form an m-part sum system.
Proof. The statement follows from Lemma 3 when we note that the identity (6) will turn into and that the set of entries of M is equal to the target set for the sum system.
Conversely, given an m-part sum system and choosing the entries on the coordinate axes of M such that they satisfy (8) and M 1m = 0, it is clear that defining the remaining entries via (9) will result in an order m tensor with property (V).
In fact, M can be considered as an m-dimensional tabular representation of the sum system with a certain arrangement of the elements of each component set.
There is some freedom of choice in assigning the elements of the component sets of a sum system to tensor entries so as to satisfy (8), with only the constraint that M 1m = 0. In order to establish a bijection, we introduce the following generalisation of Ollerenshaw and Brée's definition of a principal reversible square [8].
Definition. We call an order m tensor M ∈ N n 0 , n ∈ (N + 1) m , m ∈ N, a principal reversible m-cuboid if M has property (V), its set of entries is and for every j ∈ {1, . . . , m}, every row in the jth direction is arranged in strictly increasing order, i.e. M k < M k+lej (k ∈ N m , 1 ≤ l ≤ n j − k j ).
Putting the elements of the sum system component A j onto the jth coordinate axis of M, we obtain the following relationship by virtue of Theorem 4.
In conjunction with Theorem 1, this shows that principal reversible m-tensors also have a generalised form of the row and column reversal symmetry (R) defined for matrices [5], as follows.
If the cuboid in Lemma 5 arises by truncating a principal reversible subcuboid in one direction only, the smallest missing integer must appear on the axis of the direction of truncation, since the other directions would lead outside the larger enclosing principal reversible subcuboid.
The following statement gives an extension of this beyond the confines of the principal reversible subcuboid. Lemma 6. Letñ ≤ n,ñ = n, be such that M [ñ] is a proper principal reversible subcuboid of M, and let j ∈ {1, . . . , m}. Suppose for some k 0 ∈ N, k 0 <ñ j , a j,ñj +k = a j,k + m i=1ñ i (k ∈ k 0 ).
Then µñ +k0ej = a j,k0 + m i=1ñ i . Proof. By definition, µñ +k0ej is the smallest positive integer not in the set {Mn :n ≤ñ + k 0 e j }. Since, by Lemma 4, {Mn :n ≤ñ} = m i=1ñ i , we have in fact that µñ +k0ej is the smallest positive integer not in the set using (12) in the first and the hypothesis of the Lemma in the second equality. Taking the minimum on both sides, we find µñ +k0ej = µñ +(k0−ñj )ej + m i=1ñ i . Corollary 2 gives µñ +(k0−ñj )ej = a j,k0 , and the statement follows.
The following lemma provides the key to understanding the structure of principal reversible cuboids. Essentially it shows that, starting from a principal reversible subcuboid, finding the entry of M giving the next integer in sequence and adding the slice in the corresponding direction to the subcuboid, and continuing in this way, the next integer in sequence will always be found in the same direction as the previous one, until the addition of slices has completed a larger principal reversible subcuboid (or exhausted M ). Thus the next integer in sequence can only appear in a new direction if the starting point is a complete principal reversible subcuboid, not a general subcuboid.
Clearly, given two principal reversible subcuboids of M, one must contain the other, since both contain a consecutive sequence of integers starting from 0 and the entries of M are all different. Therefore the concept of maximality of a proper principal reversible subcuboid of M is well-defined, and there is a unique maximal proper principal reversible subcuboid of M. Proof. Supposeñ j < n j andñ k < n k for some j = k. Then, by Lemma 5, µñ ∈ {a j,ñj , a k,ñ k }; w.l.o.g. let µñ = a j,ñj . Then, by Lemma 7, the next smallest missing number from each extension in direction j will again be found in direction j, until a larger principal reversible subcuboid M [ñ+Kej ] is completed, with some K > 0. As the kth entry of the multiindex n+Ke j is equal toñ k < n k , M Proof. Since M is not just the trivial m-cuboid (0) ∈ N 1m 0 , it has a maximal proper principal reversible subcuboid M n ′ , with n ′ ≤ n, n ′ = n; note that n ′ = 1 m and hence M n ′ = (0) is possible. By Theorem 6, there is j ∈ {1, . . . , m} such that n ′ i = n i (i = j) and n ′ j < n j . Letñ ∈ N m be such thatñ i = n i (i = j) and such thatñ j is the minimal number for which M [ñ] is a principal reversible subcuboid of M.
By Lemmas 6 and 7 and eq. (12), we find and an a copy of this cuboid with entries offset with m r=1ñ r . Applying the same reasoning to this larger subcuboid, if it is not already equal to M, gives the last statement of the Theorem.
By minimality of M [ñ] , the principal reversible cuboid M must be composed of a number of complete offset copies of it to contain a complete arithmetic sequence. Hence it follows thatñ j is a divisor of n j .

Building operators and joint ordered factorisations
Theorem 7 has shown that every principal reversible cuboid, except the trivial (0) ∈ N 1m 0 , is composed of shifted copies of a smaller principal reversible cuboid, stacked in one of the m directions. By recursion, this observation gives a description of principal reversible cuboids which can be used to construct them. In order to make the construction more transparent, we introduce building operators which describe the stacking process.
Moreover, for m ∈ N and any multiindex n ∈ N m , we write 1 [n] for the cuboid with dimension vector n and all entries equal to 1.
If m = 1, then this product turns into the standard Kronecker product of the vectors v ∈ N k 0 and This product is obviously bilinear.
Definition. Let k, m ∈ N, j ∈ {1, . . . , m}. Then we define the building operator B j,k as the operation which turns any cuboid M ∈ N n 0 , n ∈ N m , into The following observation shows that the composition of two building operators working in the same coordinate direction is just one building operator.
Proof. Let M ∈ N n 0 , n ∈ N m . Then using Lemma 8 in the penultimate line.
Applying this setup in conjunction with Theorem 7, we can deduce the following structure theorem for principal reversible cuboids.
Proof. Using the building operator defined above, the statement of Theorem 7 can be paraphrased in the following way. There is some j ∈ {1, . . . , m} and f ∈ N, f |n j , such that M = B j,f (M [ñ] ), whereñ ∈ N m has entriesñ i = n i (i = j) andñ j = n j /f. Here M [ñ] is again a principal reversible cuboid. Unless this is the trivial cuboid (0) ∈ N 1m 0 , we can again apply Theorem 7 to it, and thus recursively obtain the building operator chain in (15). The last statement reflects Lemma 9, which allows fusion of consecutive building operators in the same direction into one.
Theorem 8 shows that principal reversible cuboids are obtained from building operator chains; the coefficients of such a chain arise from factorising the individual dimensions n j (j ∈ {1, . . . , m}) of the principal reversible cuboid, and arranging the factors in a sequence such that consecutive factors in the sequence belong to different coordinate directions.
Note that in the special (and untypical) case m = 2, this condition (which corresponds to the last sentence in Theorem 8) enforces alternation of directions j 1 = 1, j 2 = 2, j 3 = 1, j 4 = 2, etc. (or the analogue starting with j 2 = 2), ending with either the same or the other direction depending on whether L is odd or even. If n 1 = n 2 and we start with j 1 = 1, this gives a building operator chain equivalent to Ollerenshaw and Brée's construction of principal reversible squares [8]. However, if m > 2, then the possible patterns are considerably more complex. and j l = j l−1 (l ∈ {2, . . . , L}).
By Theorem 4, the entries on the coordinate axes of a principal reversible cuboid form a sum system (with the entries of each component set appearing in increasing order on the corresponding axis, and the coordinate axes arranged in the order of the smallest non-zero entry of the component sets). Thus the building operator chain of Theorem 8 also gives rise to a construction for the corresponding sum system, as follows.