3
$\begingroup$

Motivation. I stumbled over this riddle (unfortunately in German): the goal is to fill the numbers $1\ldots7$ (or, equivalently, $0\ldots6$) into the $7$ little circles so that the sums of all numbers along an "orbit" or a "ray" are equal.

created by Rodrigo de Azevedo on October 8, 2021

I want to generalize this using the language of hypergraphs.

Formalization. Pick any integer $n\geq 2$, and let

$$V_n = \{\infty\} \cup \big(\{0,\ldots, n-1\} \times \{0, \ldots, n\}\big).$$

The intuition behind this is that $\infty$ denotes the point "in the middle", and that $\{k\}\times \{0,\ldots, n\}$ is the $k$th "orbit" (containing $n+1$ vertices). We have $|V_n| = n(n+1) + 1$.

Next we define the edge set $E_n$: Let

$$E_n = \underbrace{\big\{\{k\} \times \{0,\ldots,n\}: k\in \{0, \ldots, n-1\}\big\}}_{\text{"orbits"}} \\ \cup \underbrace{\big\{\{\infty\}\cup (\{0,\ldots,n-1\} \times \{\ell\}): \ell \in \{0,\ldots,n\}\big\}}_{\text{"rays"}}.$$

So every member of $E_n$ contains $n+1$ elements, and we have $n$ "orbits", and $n+1$ "rays" in $E_n$, so $|E_n| = 2n+1$.

Question. For which integer $n\geq 2$ is there a bijection $\varphi: V_n \to \{0, \ldots, n(n+1)\}$ such that for any $e, e' \in E_n$ we have $$\sum_{v\in e}\varphi(v) = \sum_{v'\in e'}\varphi(v')$$?

$\endgroup$
3
  • 1
    $\begingroup$ Just a note that this isn't the only generalization. One can add another orbit to Dambeck's original puzzle and solve the puzzle of putting 0..9 into those 10 vertices with constant sums along each of 3 rays (of length 4) and the 3 orbits. That is, it's not necessary to require $n$ orbits and $n+1$ rays. $\endgroup$ Commented Jul 10, 2021 at 14:19
  • $\begingroup$ Right - thanks @BrianHopkins! $\endgroup$ Commented Jul 10, 2021 at 17:22
  • $\begingroup$ Do you mean "wrap around", i.e. a magic torus? $\endgroup$
    – Wlod AA
    Commented Jul 11, 2021 at 5:19

1 Answer 1

3
$\begingroup$

UPDATE. Solution exists for all $n\geq 2$. I have verified it computationally for $n\leq 12$ and below I give a sketch of existence proof for larger $n$.

It is easy to see that when $\varphi$ exists, we have $\varphi(\infty)=\frac{n(n+1)}2$ and the magic sum equal $\frac{n(n+1)^2}2$. Removing element $\infty$ and subtracting $\frac{n(n+1)}2$ from every other value of $\varphi$, we get an $n\times (n+1)$ magic table composed of distinct elements of $$\big\{\pm 1,\pm 2,\dots,\pm\tfrac{n(n+1)}2\big\}$$ and with zero row sums and column sums.


Let's start with description of a relatively simple construction of such a table when $n\equiv 0,2,5,7\pmod{8}$, which I will demonstrate below for $n\equiv 0\pmod{8}$.

We split the table into halves along the odd dimension, i.e., into two halves of size $\frac{n}2\times(n+1)$ each. Our goal is to fill one half of the table with the elements $$Q_n:=\big\{1, 2,\dots,\tfrac{n(n+1)}2\big\}$$ choosing their signs as needed and caring only about zero row sums. Then filling the other half with negated copy of first one will make all row and column sums zero in the whole $n\times(n+1)$ table.

We say that a finite set of integers $S$ represents an integer $t$ if there exists an assignment of signs $e:\,S\,\to\,\{-1,+1\}$ such that $\sum_{s\in S} e(s)\cdot s = t$. We will need the following lemma, which is easy to prove by induction on $m$.

Lemma. For an integer $m\geq 1$, any set of $2m$ consecutive integers represents every integer $t$ such that $|t|\leq m^2$ and $t\equiv m\pmod{2}$.

Consider any partition: $$T_1\sqcup T_2\sqcup \dots\sqcup T_{\frac{n}2} = \big\{ 1, 2, \dots, \frac{3n}4\big\},$$ where each set $T_k$ is composed of a single even number when $k\in\{1,2,\dots,\frac{3n}8\}$, and composed of 3 odd numbers when $k\in\{\frac{3n}8+1,\frac{3n}8+2,\dots,\frac{n}2\}$.

Correspondingly, consider any partition $$S_1\sqcup S_2\sqcup \dots\sqcup S_{\frac{n}2} = \big\{ \frac{3n}4+1,\frac{3n}4+2,\dots,\tfrac{n(n+1)}2\big\},$$ where the sets $S_k$ are composed of consecutive numbers such that $|S_k|=n$ when $k\in\{1,2,\dots,\frac{3n}8\}$ and $|S_k|=n-2$ when $k\in\{\frac{3n}8+1,\frac{3n}8+2,\dots,\frac{n}2\}$.

We will fill row $k$ in the halved table with elements from $T_k\cup S_k$. We take elements of $T_k$ in increasing order with alternating signs, and so their sum $t$ is smaller than $\frac{3n}4$ by absolute value, and take signs of elements of $S_k$ as imposed by Lemma to represent $-t$ and thus nullify the sum of signed elements of $T_k\cup S_k$. (It is easy to verify that that conditions of Lemma hold.)


Example. Here is an example of the above construction for $n=8$: $$ %\begin{matrix} \begin{bmatrix} {\bf +2} & -7 & +8 & +9 & -10 & +11 & -12 & +13 & -14 \\ {\bf +4} & +15 & -16 & +17 & -18 & +19 & -20 & +21 & -22 \\ {\bf +6} & +23 & -24 & +25 & -26 & +27 & +28 & -29 & -30 \\ {\bf +1} & {\bf -3} & {\bf +5} & +31 & -32 & +33 & -34 & +35 & -36 \\ \hline -2 & +7 & -8 & -9 & +10 & -11 & +12 & -13 & +14 \\ -4 & -15 & +16 & -17 & +18 & -19 & +20 & -21 & +22 \\ -6 & -23 & +24 & -25 & +26 & -27 & -28 & +29 & +30 \\ -1 & +3 & -5 & -31 & +32 & -33 & +34 & -35 & +36 \end{bmatrix}, $$ where the elements of sets $T_k$ are highlighted, and the bottom half equals the negation of the top one.


When $n\equiv 1,3,4,6\pmod{8}$, the idea of table halving does not work directly since there is an odd number of odd elements in $Q_n$. However, we can make it work by rearranging elements $\{\pm 1,\pm 2, \pm a, \pm(a+1)\}$ for some $a\geq 3$ as follows. One half will have a rectangle with corners $+1,\ -a,\ -(a+1),\ -1$ (listed clockwise), where the side connecting $\pm 1$ goes along the "even" dimension of the table. The the other half will be a negated copy of the first one, except for having elements $-2,\ +(a+1),\ +a,\ +2$ in the corresponding rectangle corners.

Here is a transposed example for $n=9$ (with halves of size $5\times 9$ rather than $9\times 5$): $$ \begin{bmatrix} {\bf +4} & +10 & -11 & +12 & -13 & +14 & -15 & +16 & -17 \\ {\bf +6} & -25 & -24 & +23 & +22 & -21 & +20 & -19 & +18 \\ {\bf +8} & +26 & -27 & +28 & +29 & -30 & +31 & -32 & -33 \\ \color{red}{\bf +1} & {\bf -3} & {\bf +5} & \color{red}{-39} & +38 & -37 & +36 & -35 & +34 \\ \color{red}{\bf -1} & {\bf +7} & {\bf -9} & \color{red}{-40} & +41 & -42 & +43 & -44 & +45 \\ \hline -4 & -10 & +11 & -12 & +13 & -14 & +15 & -16 & +17 \\ -6 & +25 & +24 & -23 & -22 & +21 & -20 & +19 & -18 \\ -8 & -26 & +27 & -28 & -29 & +30 & -31 & +32 & +33 \\ \color{red}{-2} & {+3} & {-5} & \color{red}{+40} & -38 & +37 & -36 & +35 & -34 \\ \color{red}{+2} & {-7} & {+9} & \color{red}{+39} & -41 & +42 & -43 & +44 & -45 \end{bmatrix}, $$ where the rectangles corners with $\pm1,\ \pm2,\ \pm39,\ \pm40$ are colored red, and the elements of $S_k$ are listed in zigzag fashion.

$\endgroup$

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .