[Unsolved] How many "magic squares" (combinatorial)?

  • Context: MHB 
  • Thread starter Thread starter hxthanh
  • Start date Start date
  • Tags Tags
    Squares
Click For Summary

Discussion Overview

The discussion revolves around the combinatorial properties of "magic squares," specifically focusing on the number of 3x3 magic squares with a given row sum, denoted as \( S_3(r) \). Participants explore definitions, examples, and mathematical formulations related to magic squares, including the conditions under which they are formed and the implications of using non-negative integers.

Discussion Character

  • Exploratory
  • Mathematical reasoning
  • Debate/contested

Main Points Raised

  • Some participants define a magic square as an \( n \times n \) table of non-negative integers where the sums of each row and column equal a constant \( r \).
  • Participants propose that \( S_3(r) = {r+2 \choose 4} + {r+3 \choose 4} + {r+4 \choose 4} \) as a formula for the number of 3x3 magic squares with row sum \( r \).
  • There is a question about whether the \( n^2 \) numbers in the magic square must be distinct or can include repeated values, with some arguing that they are not necessarily different.
  • Examples are provided for \( S_3(0) \) and \( S_3(1) \), showing specific configurations of magic squares that satisfy the conditions for these sums.
  • One participant suggests a transformation of the magic square to explore its properties further.
  • Another participant notes that the challenge increases significantly when considering larger squares, such as 4x4 magic squares.
  • There is a discussion about the implications of different definitions of magic squares and how they affect the calculations of \( S_3(r) \).

Areas of Agreement / Disagreement

Participants express differing views on the definition of magic squares, particularly regarding the uniqueness of the integers used. While some agree on the formula for \( S_3(r) \), there is no consensus on the implications of using non-distinct integers or the generalization to larger squares.

Contextual Notes

Limitations include the lack of clarity on the definitions of magic squares and the assumptions regarding the integers used. The discussion also highlights unresolved mathematical steps in deriving the values of \( S_3(r) \) for various sums.

hxthanh
Messages
15
Reaction score
0
A "magic square" is an $n\times n$ table includes $n^2$ non-negative integers satisfying conditions sum on each row and each column are equal and equal to $r$.
Define $S_3(r)$ is number of all $3\times 3$ magic square with row sum is $r$

Prove that:
$\displaystyle S_3(r)={r+2\choose 4}+{r+3\choose 4}+{r+4\choose 4}$

p/s: (sorry, if my thread wrong place)
 
Mathematics news on Phys.org
Re: [Unsolved] How many "magic square" (combinatorial)?

hxthanh said:
A "magic square" is an $n\times n$ table includes $n^2$ non-negative integers satisfying conditions sum on each row and each column are equal and equal to $r$.
Define $S_3(r)$ is number of all $3\times 3$ magic square with row sum is $r$

Prove that:
$\displaystyle S_3(r)={r+2\choose 4}+{r+3\choose 4}+{r+4\choose 4}$

p/s: (sorry, if my thread wrong place)

Only for clarification purpose: the $\displaystyle n^{2}$ numbers are $\displaystyle 1,2,...,n^{2}$ or a set of $n^{2}$ distinct nonnegative numbers with sum r?...

For example the following magic square with n=3...

$8\ 1\ 6$

$3\ 5\ 7$

$4\ 9\ 2$

... use the set 1,2,...,9 but in that case r is not an independent parameter because is...

$\displaystyle r = \frac{n\ (n^{2}+1)}{2} = 15$

Kind regards

$\chi$ $\sigma$
 
Re: [Unsolved] How many "magic square" (combinatorial)?

hxthanh said:
A "magic square" is an $n\times n$ table includes $n^2$ non-negative integers satisfying conditions sum on each row and each column are equal and equal to $r$.
Define $S_3(r)$ is number of all $3\times 3$ magic square with row sum is $r$

Prove that:
$\displaystyle S_3(r)={r+2\choose 4}+{r+3\choose 4}+{r+4\choose 4}$

p/s: (sorry, if my thread wrong place)
The solution to 4 x 4 squares would be a lot more of a challenge. (Nerd)
There are only four 3 x 3 magic squares, with entries < 10 and r = 15, and they are rotations of one of them. ie.
[math]\left ( \begin{array}{ccc} 8 & 1 & 6 \\ 3 & 5 & 7 \\ 4 & 9 & 2 \end{array} \right )[/math], [math]\left ( \begin{array}{ccc} 4 & 3 & 8 \\ 9 & 5 & 1 \\ 2 & 7 & 6 \end{array} \right )[/math], [math]\left ( \begin{array}{ccc} 2 & 9 & 4 \\ 7 & 5 & 3 \\ 6 & 1 & 8 \end{array} \right )[/math], [math]\left ( \begin{array}{ccc} 6 & 7 & 2 \\ 1 & 5 & 9 \\ 8 & 3 & 4 \end{array} \right )[/math]

You can play with this for higher numbers than 1 - 9, but you will still only have the four rotated solutions. Thus, for valid values of r, [math]S_3(r) = 4[/math].
-Dan

Addendum:
You can also have "reflections" of the original square. Such as
[math]\left ( \begin{array}{ccc} 6 & 1 & 8 \\ 7 & 5 & 3 \\ 2 & 9 & 4 \end{array} \right )[/math]
and the like, so we get 8 more squares for a total of 12 overall.

Did I miss any more?

-Dan
 
Last edited by a moderator:
Re: [Unsolved] How many "magic square" (combinatorial)?

$n^2$ non-negative integers is not necessarily different!

$\displaystyle S_3(0)={0+2\choose 4}+{0+3\choose 4}+{0+4\choose 4}=1$
$$\begin{matrix}0&0&0\\0&0&0\\0&0&0\end{matrix}$$
$\displaystyle S_3(1)={1+2\choose 4}+{1+3\choose 4}+{1+4\choose 4}=6$

$\begin{bmatrix}1&0&0\\0&1&0\\0&0&1\end{bmatrix} \quad \begin{bmatrix}1&0&0\\0&0&1\\0&1&0\end{bmatrix} \quad \begin{bmatrix}0&1&0\\1&0&0\\0&0&1\end{bmatrix} \quad \begin{bmatrix}0&1&0\\0&0&1\\1&0&0\end{bmatrix} \quad \begin{bmatrix}0&0&1\\0&1&0\\1&0&0\end{bmatrix} \quad \begin{bmatrix}0&0&1\\1&0&0\\0&1&0\end{bmatrix}$

$S_3(2)=21$

etc...

I tried transform magic square to follow
$$\begin{array}{|c|c|}\hline a&r-a-b&b\\ \hline r-a-c&a+b+c+d-r&r-b-d\\ \hline c&r-c-d&d\\ \hline\end{array}$$
 
Last edited:
Re: [Unsolved] How many "magic square" (combinatorial)?

hxthanh said:
$n^2$ non-negative integers is not necessarily different!

$\displaystyle S_3(0)={0+2\choose 4}+{0+3\choose 4}+{0+4\choose 4}=1$
$$\begin{matrix}0&0&0\\0&0&0\\0&0&0\end{matrix}$$
$\displaystyle S_3(1)={1+2\choose 4}+{1+3\choose 4}+{1+4\choose 4}=6$

$\begin{bmatrix}1&0&0\\0&1&0\\0&0&1\end{bmatrix} \quad \begin{bmatrix}1&0&0\\0&0&1\\0&1&0\end{bmatrix} \quad \begin{bmatrix}0&1&0\\1&0&0\\0&0&1\end{bmatrix} \quad \begin{bmatrix}0&1&0\\0&0&1\\1&0&0\end{bmatrix} \quad \begin{bmatrix}0&0&1\\0&1&0\\1&0&0\end{bmatrix} \quad \begin{bmatrix}0&0&1\\1&0&0\\0&1&0\end{bmatrix}$

$S_3(2)=21$

etc...

I tried transform magic square to follow
$$\begin{array}{|c|c|}\hline a&r-a-b&b\\ \hline r-a-c&a+b+c+d-r&r-b-d\\ \hline c&r-c-d&d\\ \hline\end{array}$$
Okay. I have never seen magic squares with repeated numbers in them, so I guess my solutions would not be called "general."

-Dan
 
Re: [Unsolved] How many "magic square" (combinatorial)?

hxthanh said:
$n^2$ non-negative integers is not necessarily different!

$\displaystyle S_3(0)={0+2\choose 4}+{0+3\choose 4}+{0+4\choose 4}=1$
$$\begin{matrix}0&0&0\\0&0&0\\0&0&0\end{matrix}$$
$\displaystyle S_3(1)={1+2\choose 4}+{1+3\choose 4}+{1+4\choose 4}=6$

$\begin{bmatrix}1&0&0\\0&1&0\\0&0&1\end{bmatrix} \quad \begin{bmatrix}1&0&0\\0&0&1\\0&1&0\end{bmatrix} \quad \begin{bmatrix}0&1&0\\1&0&0\\0&0&1\end{bmatrix} \quad \begin{bmatrix}0&1&0\\0&0&1\\1&0&0\end{bmatrix} \quad \begin{bmatrix}0&0&1\\0&1&0\\1&0&0\end{bmatrix} \quad \begin{bmatrix}0&0&1\\1&0&0\\0&1&0\end{bmatrix}$

$S_3(2)=21$

etc...

I tried transform magic square to follow
$$\begin{array}{|c|c|}\hline a&r-a-b&b\\ \hline r-a-c&a+b+c+d-r&r-b-d\\ \hline c&r-c-d&d\\ \hline\end{array}$$

Ok!... if we accept [because there are different definitions of 'magic square'...] that a 'magic square' is a n x n matrix with the sum of the elemnts of all rows and colums is the same number k, then, indicating $M_{n} (k)$ an n x n magic square with 'magic number' k, the following basic statement should hold...

$\displaystyle A_{n} (k) + B_{n} (1) = C_{n} (k+1)\ (1)$

... i.e. a magic square with magic number k+1 is the sum of a magic square with magic number k and a magic square with magic number 1. Now You have found that $\displaystyle S_{3} (0)=1$ and $\displaystyle S_{3} (1) = 6$... all right!...

Now $\displaystyle S_{3} (2)$ can be obtained computing the possible distict sum of all the magic square magic number 1 that is $\displaystyle S_{3} (2) = 6 + 5 + 4 + 3 + 2 + 1 = 21$. The behaviour for k > 2 will be analysed in next post...

Kind regards

$\chi$ $\sigma$
 
Last edited:
Re: [Unsolved] How many "magic square" (combinatorial)?

hxthanh said:
A "magic square" is an $n\times n$ table includes $n^2$ non-negative integers satisfying conditions sum on each row and each column are equal and equal to $r$.
Define $S_3(r)$ is number of all $3\times 3$ magic square with row sum is $r$

Prove that:
$\displaystyle S_3(r)={r+2\choose 4}+{r+3\choose 4}+{r+4\choose 4}$
MY SOLUTION
First, we creating 2 rows into square by 2 equations $a_1+a_2+a_3=b_1+b_2+b_3=n$
Number of solutions of both equations as ${n+2\choose 2}$
Therefor, number of squares as ${n+2\choose 2}^2$ including type non-magic squares.

For each square created above, we seeking inappropriate condition:
$\begin{array}{|c|c|c|} \hline\\ a & b & n-a-b \\ \hline c & d & n- c-d\\ \hline n- a-c & n- b-d & a+b+c+d-n \\ \hline \end{array}$

We get condition is $a+b+c+d < n \Leftrightarrow a+b+c+d+e=n, \quad (0<e\le n)\quad (*)$
Number of solutions $(*)$ as ${n+3\choose 4}$
Similarly for the terms of 3th-row.

Result: Number of magic-square as
${n+2\choose 2}^2 -3 {n+3\choose 4}={n+4\choose 4} + {n+3\choose 4} + {n+2\choose 4} \quad \square$
 

Similar threads

  • · Replies 68 ·
3
Replies
68
Views
12K
  • · Replies 1 ·
Replies
1
Views
2K
  • · Replies 8 ·
Replies
8
Views
2K
  • · Replies 2 ·
Replies
2
Views
2K
  • · Replies 1 ·
Replies
1
Views
4K
  • · Replies 1 ·
Replies
1
Views
1K
  • · Replies 2 ·
Replies
2
Views
2K
Replies
3
Views
2K
  • · Replies 8 ·
Replies
8
Views
2K
  • · Replies 1 ·
Replies
1
Views
3K