Signed Magic Rectangles With Two Filled Cells in Each Column

Abdollah Khodkar1, Brandi Ellis2
1Department of Mathematics University of West Georgia Carrollton, GA 30118
2Department of Mathematics University of West Georgia Carrollton, GA 30118

Abstract

A signed magic rectangle SMR(m,n;r,s) is an m×n array with entries from X, where X={0,±1,±2,,±(ms1)/2} if mr is odd and X={±1,±2,,±mr/2} if mr is even, such that precisely r cells in every row and s cells in every column are filled, every integer from set X appears exactly once in the array, and the sum of each row and of each column is zero. In this paper, we prove that a signed magic rectangle SMR(m,n;r,2) exists if and only if m=2 and n=r0,3(mod4) or m,r3 and mr=2n.

Keywords: Graph, Signed magic rectangle

1. Introduction

A magic rectangle of order m×n, MR(m,n), is an arrangement of the numbers from 0 to mn1 in an m×n rectangle such that each number occurs exactly once in the rectangle and the sum of the entries of each row is the same and the sum of entries of each column is also the same. The following theorem, whose proof can be found in [1,2] and [3], settles the existence of an MR(m,n).

Theorem 1. An m×n magic rectangle exists if and only if mn(mod2), m+n>5, and m,n>1.

A k-magic square of order n is an arrangement of the numbers from 0 to kn1 in an n×n array such that each row and each column has exactly k filled cells, each number occurs exactly once in the array, and the sum of the entries of any row or any column is the same. The study of magic squares with empty cells was initiated in [4]. A magic square is called kdiagonal if its entries all belong to k consecutive diagonals (this includes broken diagonals as well).

Theorem 2. [4] There exists a k-diagonal magic square of order n if and only if n=k=1 or 3kn and either n is odd or k is even.

A signed magic rectangle SMR(m,n;r,s) is an m×n array with entries from X, where X={0,±1,±2,,±(ms1)/2} if mr is odd and X={±1,±2,,±mr/2} if mr is even, such that precisely r cells in every row and s cells in every column are filled, every integer from set X appears exactly once in the array and the sum of each row and of each column is zero. By the definition, mr=ns, rn and sm. If r=n or s=m, then the rectangle has no empty cell. In the case where m=n, we call the array a signed magic square. Signed magic squares represent a type of magic square where each number from the set X is used once.

The following two theorems can be found in [5].

Theorem 3. An SMR(m,n) exists precisely when m=n=1, or when m=2 and n0,3(mod4), or when n=2 and m0,3(mod4), or when m,n>2.

In [5] the notation SMS(n;k) is used for a signed magic square with k filled cells in each row and k filled cells in each column.

Theorem 4. There exists an SMS(n;k) precisely when n=k=1 or 3kn.

In this paper we prove that a signed magic rectangle SMR(m, n;r,2) exists if and only if m=2 and n=r0,3(mod4) or m,r3 and mr=2n.

Being the smallest poset that contains G, G is called the principle ideal generated G, which we refer to as a graph ideal. So, we can describe G as a union of graph ideals. However, the use of order theory here is not superficial. Our main method for determining the down-arrow Ramsey set relies on viewing red-blue colorings of a graph as unions of graph ideals.

2. Main Constructions

A rectangular array is shiftable if it contains the same number of positive entries as negative entries in every column and in every row. Figure 1 displays a shiftable SMR(2,4;4,2). These arrays are called shiftable because they may be shifted to use different absolute values. By increasing the absolute value of each entry by k, we add k to each positive entry and k to each negative entry. If the number of entries in a row is 2, this means that we add k+(k)=0 to each row, and the same argument applies to the columns. Thus, when shifted, the array retains the same row and column sums.

12341234

Figure 1: A Shiftable SMR(2,4;4,2)

Theorem 5. Let there exist a shiftable SMR(m,n;r,s). Then for every k1

  1. there exists a shiftable SMR(m,kn;kr,s) and

  2. there exists a shiftable SMR(km,kn;r,s) .

Proof. Let A be a shiftable SMR(m,n;r,s). Note that since A is shiftable, it follows that r and s are both even. Partition an empty m×kn rectangle, say B, into k empty rectangles of size m×n, say P, where 0k1. For each (i,j;e)A we fill the cell (i,j) of P with e+(mr/2) if e is positive or with e(mr/2) if e is negative. The resulting rectangle is a shiftable SMR(m,kn;kr,s). See Figure 2.

123456789101112123456789101112

Figure 2: A Shiftable SMR(2,12;12,2)

123412345678567891011129101112 ◻

Figure 3: A Shiftable SMR(6,12;4,2)

Theorem 6. Let there exist a shiftable SMR(m,n;r,s) and a (shiftable) SMR(m,n;r,s) with mr even. Then there exists a (shiftable) SMR(m,kn+n;kr+r,s) for k1.

Proof. Apply Part 1 of Theorem 5 with a shiftable SMR(m,n;r,s) to obtain a shiftable SMR(m,kn;kr,s), say A, for k1. Let B be a (shiftable) SMR(m,n;r,s) and let C be the m×kn rectangle obtained from A by adding mr/2 to each positive entry of A and subtracting mr/2 from each negative entry of A. Finally, let D be the m×(kn+n) rectangle obtained from B and C as follows: if (i,j;e)B, then (i,j;e)D and if (i,j;e)C, then (i,j+n;e)D. It is easy to see that D is a (shiftable) SMR(m,kn+n;kr+r,s)◻

Figure 4 displays an SMR(2,11;11,2) obtained by the construction given in the proof of Theorem 6 using the shiftable SMR(2,4;4,2) given in Figure 1, an SMR(2,3;3,2) and k=2.

12345678910111234567891011

Figure 4: An SMR(2,11;11,2)

Theorem 7. Let there exist a shiftable SMR(m,n;r,s) and a (shiftable) SMR(m,n;r,s) with mr even., then there exists a (shiftable) SMR(km+m,kn+n;r,s) for k1.

Proof. Apply Part 2 of Theorem 5 with a shiftable SMR(m,n; r,s) to obtain a shiftable SMR(km,kn;r,s), say A, for k1. Let B be a (shiftable) SMR(m,n;r,s) and let C be the m×kn rectangle obtained from A by adding mr/2 to each positive entry of A and subtracting mr/2 from each negative entry of A. Finally, let D be the (km+m)×(kn+n) rectangle obtained from B and C as follows: if (i,j;e)B, then (i,j;e)D and if (i,j;e)C, then (i+m,j+n;e)D. It is easy to see that D is a (shiftable) SMR(km+m,kn+n;r,s)◻

Figure 5 displays a shiftable SMR(7,14;4,2) obtained by the construction given in the proof of Theorem 7 using the shiftable SMR(2,4;4,2) given in Figure 1, the shiftable SMR(3,6;4,2) given in Figure 1, and k=2.

13461245235678910789101112131411121314

Figure 5: A Shiftable SMR(7,14;4,2)

3. The Existence of an SMR(m,3m/2;3, 2) and an SMR(m,5m/2;5,2)

In this section we present direct constructions for the existence of an SMR(m,3m/2;3,2), where m2 and even, and an SMR(m,5m/2;5,2), where m4 and even. We will make use of these results in Section 4. Note that if m is odd there is no SMR(m,3m/2;3, 2) because 3m is odd and there is no SMR(m,5m/2;5,2) because 5m is odd.

Proposition 1. There exists an SMR(m,3m/2;3,2) for m even and m2.

Proof. Define an m×3 rectangle A as follows.

Column 1: {(i,1;i)A for 1im/2,(i,1;(m/2)i)A for (m/2)+1im.

Column 2: {(i,2;(3m/2)2i+1)A for 1im/2,(i,2;i)A for (m/2)+1im.

Column 3: {(i,3;(3m/2)+i1)A for 1im/2,(i,3;(m/2)+2i)A for (m/2)+1im.

By construction, it is easy to see that the entries in A consist of {±1,±2,,±3m/2}, which are the numbers in an SMR(m, 3m/2;3,2). Figure [A.m=8.3.2] displays the rectangle A when m=8,10. We now prove that the sum of each row of A is zero. The row sum for row i of A, where 1im/2, is i+((3m/2)2i+1)+((3m/2)+i1)=0. Similarly, the row sum for row i of A, where (m/2)+1im, is ((m/2)i)+(i)+((m/2)+2i)=0.

Let a,k and k be the numbers in a row of A. Then a+k+(k)=0, which implies that a=0. Since zero does not appear in A, it follows that the numbers k and k do appear in the same row of A.

Now let B be an empty m×3m/2 rectangle. For each (i,j;k)A let (i,|k|;k)B. By construction, the numbers in row i of B are precisely the numbers in row i of A. Therefore the row sum for each row of B is also zero. Since ±k are entries of A for each 1k3m/2, it follows that column k of B contains only k and k. Hence, B is an SMR(m,3m/2;3,2) for m even and m2◻

Figure [8,12;3,2] displays an SMR(8,12;3,2) obtained by the construction given in Proposition 1.

111122911371045915626837104812114152121431013481256111672793811491351015 Array A when m=8 Array A when m=10

Figure 6: Array A Given in Proposition 1

111122911371045915626837104812

Figure 7: An SMR(8,12;3,2)

It is an easy exercise to see that there is no SMR(2,5;5,2). The following proposition shows how to build an SMR(m,5m/2;5,2) for m even and m4.

Proposition 2. There exists an SMR(m,5m/2;5,2) for m even and m4.

Proof. Define a m×5 rectangle C as follows.

Column 1: {(i,1;i)C for 1im/2,(i,1;(m/2)i)C for m+22im.

Column 2: {(i,2;(m/2)+2i1)C for 1im/2,(i,2;(3m/2)+i1)C for m+22im.

Column 3: {(i,3;(m)i)C for 1im/2,(i,3;(5m/2)2i+2)C for m+22im.

Column 4: {(i,4;(3m/2)i)C for 1i(m/2),(i,4;(3m/2)+i)C for m+22im.

Column 5: {(i,5;2mi+1)C for 1im/2,(i,5;3m+i1)C for m+22im.

By construction, the entries in C consist of {±1,,±5m/2}, which are the numbers in an SMR(m,5m/2;5,2). Figure 7 displays the rectangle C when m=8. We now prove that the sum of each row of C is zero. The row sum for row i of C, where 1im/2, is i+((m/2)+2i1)+(mi)+((3m/2)i)+(2mi+1)=0. Similarly, the row sum for row i of C, where (m/2)+1im, is ((m/2)i)+((3m/2)+i1)+(5m/2)2i+2)+((3m/2)+i)+(3m+i1)=0.

Let a,b,c,d,e be the numbers in row i and columns 1,2,3,4,5 of C, respectively. It is straightforward to see that if x,y{a,b,c} and z{d,e}, then x+y0 and x+z0. Now let d+e=0. If 1im/2, then d+e=((3m/2)i)+(2mi+1)=(m/2)2i+1=0. This implies that i=(m+2)/4.

If (m/2)+1im, then d+e=((3m/2)+i)+(3m+i1)=(3m/2)+2i1=0. This implies that i=(3m+2)/4.

Therefore if m0(mod4), then the numbers k and k do not appear in the same row of C. If m2(mod4) and i(m+2)/2,(3m+2)/4, then the numbers k and k do not appear in row i of C.

When m2(mod4) we construct an m×5 array C by rearranging the eight entries of C which are in the intersection of columns 1 and 2 with rows (m2)/2,(m+2)/2,(3m2)/4 and (3m+2)/4 as follows. Switch ((m2)/4,1;(m2)/4) and (m+2)/4,1;(m+2)/4),((m2)/4,5;(7m+6)/4) and ((m+2)/4,5;(7m+2)/4),((3m2)/4,1;(m+2)/4) and (3m+2)/4,1;(m2)/4),and ((3m2)/4,5;(9m6)/4) and ((3m+2)/4,5;(9m2)/4). Figure 7 displays the rectangle C when m=10. It is easy to see that the sum of each row of C is zero and k and k do not appear in any row of C.

Now let m0(mod4), m4, and let D be an empty m×5m/2 rectangle. For each (i,j;k)C let (i,|k|;k)D. By construction, the numbers in row i of D are precisely the numbers in row i of C. Therefore the row sum for each row of D is also zero. Since ±k are entries of C for each 1k5m/2, it follows that column k of D contains only k and k. Hence, D is an SMR(m,5m/2;5,2).

Similarly, if m2(mod4) and m6, we use the array C to build an SMR(m,5m/2;5,2)◻

159131627101415391115144111216131812172027101819368191845620171611162038121718210131819412141917514152016110152125391322232811232447924225672521Array C when m=8Array C when m=10

Figure 8: Arrays C and C Constructed by Proposition

4. The Existence of an SMR(m,n;r,2) with m Even

Let there exist an SMR(m,n;r,2). If m=4b or m=4b+2, then n=2br or n=(2b+1)r, respectively. We study the existence of an SMR(4b,2br;r,2) and an SMR(4b+2,(2b+1)r;r,2) in the following two subsections, respectively.

4.1. The Existence of an SMR(4b,2br;r,2)

In this subsection we construct signed magic rectangles with parameters (4b,8ab;4a,2), (4b,2b(4a+2);4a+2,2), (4b,2b(4a+1);4a+1,2), and (4b,2b(4a+3);4a+3,2), where a,b1.

Lemma 1. There exists a shiftable SMR(2q,4pq;4p,2) for positive integers p,q1.

Proof. Figure 1 displays a shiftable SMR(2,4;4,2). So by Part 1 of Theorem 5, there exists a shiftable SMR(2,4p;4p,2) for p1. Now by Part 2 of Theorem 5 there exists a shiftable SMR(2q,4pq;4p,2) for p,q1◻

Lemma 2. There exists a shiftable SMR(4b,8ab;4a,2) for a, b1.

Proof. Apply Lemma 1 with p=a and q=2b to obtain a shiftable SMR(4b,8ab;4a,2) for all a,b1◻

Lemma 3. There exists a shiftable SMR(4b,2b(4a+2);4a+2,2) for a,b1.

Proof. Figure 9 displays a shiftable SMR(4,12;6,2). So by Part 2 of Theorem 5, there exists a shiftable SMR(4b,12b;6,2), say A, for b1. On the other hand, by Lemma 2, there exists a shiftable SMR(4b,8(a1)b;4(a1),2), say B, for a2 and b1. Now apply Theorem 6 with A and B to obtain a shiftable SMR(4b,2b(4a+2);4a+2,2) for a,b1◻

125691112569113478101234781012

Figure 9: A Shiftable SMR(4,12;6,2)

Lemma 4. There exists a shiftable SMR(4b,2b(4a+1);4a+1,2) for a,b1.

Proof. By Proposition 1, there exists an SMR(4b,10b;5,2), say A, for b1. On the other hand, by Lemma 2, there exists a shiftable SMR(4b,8(a1)b;4(a1),2), say B, for a2 and b1. Now apply Theorem 6 with A and B to obtain an SMR(4b,2b(4a+1);4a+1,2) for a2 and b1. When a=1 we apply Proposition 1. ◻

Lemma 5. There exists a shiftable SMR(4b,2b(4a+3);4a+3,2) for a,b1.

Proof. By Proposition 1, there exists an SMR(4b,6b;3,2), say A, for b1. On the other hand, by Lemma 2, there exists a shiftable SMR(4b,8ab;4a,2), say B, for a,b1. Now apply Theorem 6 with A and B to obtain SMR(4b,2b(4a+3);4a+3,2) for a,b1◻

4.2. The Existence of an SMR(4b+2,(2b+1)r;r,2)

In this subsection we construct signed magic rectangles with parameters (4b+2,2a(4b+2);4a,2), (4b+2,(2a+1)(4b+2);4a+2,2), (4b+2,(4a+1)(2b+1);4a+1,2), and (4b+2,(4a+3)(2b+1);4a+3,2) for all a,b1.

Lemma 6. Let n3(mod4). Then there exists an SMR(2,n; n,2).

Proof. By Lemma 1, there exists a shiftable SMR(2,4k;4k,2), say A, for k1. Let B be a 2×3 array with first row 1,2,3 and second row 1,2,3. Then B is an SMR(2,3;3,2). Now apply Theorem 6 with A and B to obtain an SMR(2,4k+3;4k+3,2). See Figure 4. ◻

Lemma 7. There exists a shiftable SMR(4b+2,2a(4b+2);4a,2) for a,b1.

Proof. Apply Lemma 1 with p=a and q=2b+1 to obtain a shiftable SMR(4b+2,2a(4b+2);4a,2) for a,b1◻

Lemma 8. There exists a shiftable SMR(4b+2,3(4b+2);6,2) for b1

Proof. Apply Part 2 of Theorem 5 with the shiftable SMR(4,12; 6,2) displayed in Figure 9 to obtain a shiftable SMR(4(b1),12(b1);6,2), say A. Then apply Theorem 7 with A and the shiftable SMR(6,18;6,2) displayed in Figure 10 to obtain a shiftable SMR(4b+2,3(4b+2);6,2)◻

137813142489141535910151646101116171511121318267121718

Figure 10 :A SMR(6,18;6,2)

Lemma 9. There exists a shiftable SMR(4b+2,(2a+1)(4b+2);4a+2,2) for a,b1.

Proof. By Lemma 8, there is a shiftable SMR(4b+2,3(4b+2);6,2) for b1, say A. Apply Lemma 1 with p=a1 and q=2b+1 to obtain a shiftable SMR(2(2b+1),4(a1)(2b+1);4(a1),2), say B, for a2 and b1. Finally, apply Theorem 6 with arrays A and B to obtain a shiftable SMR(4b+2,(2a+1)(4b+2);4a+2,2) for a2 and b1. When a=1 apply Lemma 8. ◻

Lemma 10. There exists an SMR(4b+2,(4a+1)(2b+1);4a+1,2) for a,b1.

Proof. Apply Lemma 1 with p=a1 and q=2b+1 to obtain a shiftable SMR(2(2b+1),4(a1)(2b+1);4(a1),2), say A, for a2. By Proposition 1 there is an SMR(4b+2,5(2b+1);5,2), say B, for b1. Finally, apply Theorem 6 with arrays A and B to obtain an SMR(4b+2,(4a+1)(2b+1);4a+1,2) for a,b1◻

Lemma 11. There exists an SMR(4b+2,(4a+3)(2b+1);4a+3,2) for a,b0.

Proof. Apply Lemma 1 with p=a and q=2b+1 to obtain a shiftable SMR(2(2b+1),4a(2b+1);4a,2), say A. By Proposition 1 there is an SMR(4b+2,3(2b+1);3,2), say B, for b1. Finally, apply Theorem 6 with arrays A and B to obtain an SMR(4b+2,(4a+3)(2b+1);4a+3,2) for a,b1◻

We conclude this section with the following theorem.

Theorem 8. Let m be even. There exists an SMR(m,n;r,2) if and only if m=2 and n=r0,3(mod4) or m4, r3 and mr=2n.

5. The existence of an SMR(m,n;r,2) with m odd and r even

In this section we investigate the existence of a signed magic rectangle (m,n;r,2) with m odd and r even. Note that if m and r are both odd, the is no SMR(m,n;r,2).

5.1. The existence of an SMR(m,n;4a,2) with m odd

We consider two cases: m=4b+1 and m=4b+3.

Lemma 12. There exists a shiftable SMR(4b+1,2a(4b+1);4a,2) for all a,b1.

Proof. Apply Lemma 1 with p=a=1 and q=2(b1) to obtain a shiftable SMR(4(b1),8(b1);4,2) for b2.

Figure 11 displays a shiftable SMR(5,10;4,2). Therefore there is a shiftable SMR(4b+1,2(4b+1);4,2) by Theorem 7. Now apply Part 1 of Theorem 5 to obtain a shiftable SMR(4b+1,2a(4b+1);4a,2) for all a,b1◻

1561012672378348945910

Figure 11: A Shiftable SMR(5,10;4,2)

Lemma 13. There exists a shiftable SMR(4b+3,2a(4b+3);4a,2) for all a,b1.

Proof. Apply Lemma 1 with p=1 and q=2b to obtain a shiftable SMR(4b,8b;4,2) for b1. Figure 1 displays a shiftable SMR(3,6;4,2). Therefore, by Theorem 7, there is a shiftable SMR(4b+3,2(4b+3);4,2). We now apply Part 1 of Theorem 5 to obtain a shiftable SMR(4b+3,2a(4b+3);4a,2) for all a,b1◻

134612452356

Figure 12: A Shiftable SMR(3,6;4,2)

5.2. The existence of an SMR(m,n;4a+2,2) with m odd

We consider two cases: m=4b+1 and m=4b+3.

Lemma 14. There exists a shiftable SMR(4b+1,3(4b+1);6,2) for all b1.

Proof. Apply Part 2 of Theorem 5 with the shiftable SMR(4,12; 6,2) given in Figure 9 to obtain a shiftable SMR(4(b1),12(b1);6,2) for b1. Figure 13 displays a shiftable SMR(5,15;6,2). Therefore there is a shiftable SMR(4b+1,3(4b+1);6,2) for b1 by Theorem 7. ◻

126101215236713153478111345891214159101114

Figure 13: A Shiftable SMR(5,15;6,2)

Lemma 15. There exists a shiftable SMR(4b+1,(2a+1)(4b+1);4a+2,2) for all a,b1.

Proof. Apply Lemma 1 with p=1 and q=2b2 to obtain a shiftable SMR(2(2b2),4(2b2);4,2) for b2. Figure 11 displays a shiftable SMR(5,10;4,2). Therefore there is a shiftable SMR(4b+1,2(4b+1);4,2) for b1 by Theorem 7. Now apply Part 1 of Theorem 5 to obtain a shiftable SMR(4b+1,2(a1)(4b+1);4(a1),2), say A1, for all a2 and b1. By Lemma 14 there exists a shiftable SMR(4b+1,3(4b+1);6,2) for b1, say A2. Now apply Theorem 6 with A1 and A2 to obtain a shiftable SMR(4b+1,(2a+1)(4b+1);4a+2,2) for a2 and b1. When a=1, we apply Lemma 14. ◻

Lemma 16. There exists a shiftable SMR(4b+3,3(4b+3);6,2) for all b1.

Proof. Apply Part 2 of Theorem 5 with the shiftable SMR(4,12; 6,2) given in Figure 9 to obtain a shiftable SMR(4b,12b;6,2) for b1. Figure 14 displays a shiftable SMR(3,9;6,2). Therefore there is a shiftable SMR(4b+3,3(4b+3);6,2) by Theorem 7. ◻

124678234579135689

Figure 14: A Shiftable SMR(3,9;6,2)

Lemma 17. There exists a shiftable SMR(4b+3,(2a+1)(4b+3);4a+2,2) for all a,b1.

Proof. Apply Lemma 1 with p=1 and q=2b to obtain a shiftable SMR(2(2b),4(2b);4,2) for b1. Figure 1 displays a shiftable SMR(3,6;4,2). Therefore there is a shiftable SMR(4b+3,2(4b+3);4,2) by Theorem 7. Now apply Part 1 of Theorem 5 to obtain a shiftable SMR(4b+3,2(a1)(4b+3);4(a1),2), say A1, for all a2 and b1. By Lemma 16 there exists a shiftable SMR(4b+3,3(4b+3);6,2), say A2, for b1. Now apply Theorem 6 with A1 and A2 to obtain a shiftable SMR(4b+3,(2a+1)(4b+3);4a+2,2) for a2 and b1. When a=1 we apply Lemma 16. ◻

We summarise the results obtained in Lemmas 14-17 in the next theorem..

Theorem 9. Let m be odd and r be even. Then there exists an SMR(m,n;r,2) if and only if m3, r4 and mr=2n.

We are now ready to state the main theorem of this paper.

Main Theorem. There exists an SMR(m,n;r,2) if and only if m=2 and n=r0,3(mod4) or m,r3 and mr=2n.

References:

  1. Harmuth, T., 1881. Ueber magische Quadrate und ahnliche Zahlenfiguren. Archiv der Mathematik und Physik, 66, pp.286-313.
  2. Harmuth, T., 1881. Ueber magische Rechtecke mit ungeraden Seitenzahlen. Archiv der Mathematik und Physik, 66, pp.413-447.
  3. Sun, R. G., 1990. Existence of magic rectangles. Nei Mongol Daxue Xuebao Ziran Kexue, 21, pp.10-16.
  4. Khodkar, A. and Leach, D. 2021. Magic squares with empty cells. Ars Combinatoria, 154, 45-52.
  5. Khodkar, A., Schulz, C. and Wagner, N., 2017. Existence of some signed magic arrays. Discrete Mathematics, 340(5), pp.906-926.