We find by applying MacMahon's partition analysis that all magic squares of order three, up to rotations and reflections, are of two types, each generated by three basis elements. A combinatorial proof of this fact is given.
We define a magic square to be a square matrix whose entries are nonnegative integers and whose rows, columns, and main diagonals sum up to the same number. We prove structural results for the number of such squares as a function of the size of the matrix and the line sum. We give examples for small sizes and show similar results for symmetric, pandiagonal magic squares, and magic hypercubes.
The aim of this note is to introduce fastest new general methods for the construction of double and single even order magic squares. As in [5], the method for double even order magic squares is fairly straight-forward but some adjustments are necessary for the single even order magic squares.
Based on the work of Green, Tao and Ziegler, we give asymptotics when $N \to \infty$ for the number of $n \times n$ magic squares with their entries being prime numbers in $[0,N]$. For every $n \ge 3$ we give appropriate systems of linear forms (or equivalently basis) describing all $n \times n$ magic squares with integer entries and we calculate the complexity of these systems in the Green and Tao sense. We compute the precise asymptotics for the cases $n=3$ (complexity 3) and $n=4$ (complexity 1), and the given algorithm works for $n \ge 5$ (complexity 1). Finally, we show that the asymptoti…
An associative magic square is a magic square such that the sum of any 2 cells at symmetric positions with respect to the center is constant. The total number of associative magic squares of order 7 is enormous, and thus, it is not realistic to obtain the number by simple backtracking. As a recent result, Artem Ripatti reported the number of semi-magic squares of order 6 (the magic squares of 6x6 without diagonal sum conditions) in 2018. In this research, with reference to Ripatti's method of enumerating semi-magic squares, we have calculated the total number of associative magic squares of or…
The aim of this note is to introduce a fast new general method for the construction of double and single even order magic squares. The method for double even order magic squares is fairly straight-forward but some adjustment is necessary for single even order magic squares.
Using computational algebraic geometry techniques and Hilbert bases of polyhedral cones we derive explicit formulas and generating functions for the number of magic squares and magic cubes.
We describe how to construct and enumerate Magic squares, Franklin squares, Magic cubes, and Magic graphs as lattice points inside polyhedral cones using techniques from Algebraic Combinatorics. The main tools of our methods are the Hilbert Poincare series to enumerate lattice points and the Hilbert bases to generate lattice points. We define polytopes of magic labelings of graphs and digraphs, and give a description of the faces of the Birkhoff polytope as polytopes of magic labelings of digraphs.
Frierson used a powerful parameterization of the pattern of the order 3 associative magic square to construct a family of six related order 9 compound (or composite) magic squares, several of them ancient. Stimulated by Bellew's 1997 extension to order 27, we extend these ideas to all orders that are powers of 3, and in addition find simple formulae for the matrix spectra and entropic measures for all those orders. This construction is fractal and we give numerical results to order 243 which show an information entropy measure converging to a constant value of about 1.168.. for the lowest entr…
A k-magic square of order n is an arrangement of the numbers from 0 to kn-1 in an n by n matrix, such that each row and each column has exactly k filled cells, each number occurs exactly once, and the sum of the entries of any row or any column is the same. A magic square is called k-diagonal if its entries all belong to k consecutive diagonals. In this paper we prove that a k-diagonal magic square exists if and only if n = k = 1 or 3 <= k <=n and n is odd or k is even.
This is a translation of Leonhard Euler's ``De quadratis magicis'' . It is E795 in the Enestrom index. This paper studies how to construct magic squares with certain numbers of cells, in particular 9, 16, 25 and 36. It considers some general rules for making squares of even and odd orders. Euler uses Graeco-Latin squares and constrains the values that the variables can take to make magic squares. I think this is where the terms ``Latin'' and ``Graeco-Latin'' square comes from, since he uses Latin letters in one square and Greek (i.e. ``Graeco'') letters in another for each construction. (This …
Magic squares are arrangements of natural numbers into square arrays, where the sum of each row, each column, and both diagonals is the same. In this paper, the concept of a magic square with 3 rows and 3 columns is generalized to define magic polygons. Furthermore, this paper will examine the existence of magic polygons, along with several other properties inherent to magic polygons.
General methods for the construction of magic squares of any order have been searched for centuries. There have been several standard strategies for this purpose, such as the knight movement, or the construction of bordered magic squares, which played an important role in the development of general methods. What we try to do here is to give a general and comprehensive approach to the construction of magic borders, capable of assuming methods produced in the past like particular cases. This general approach consists of a transformation of the problem of constructing magic borders to a simpler -…
In an analogous construction as by Euler for 4x4 matrices, a parametrization of 8x8 magic squares of squares with orthogonal rows is shown to be obtainable by extending the quaternionic method, as shown by Hurwitz, to octonions, but not possible to be carried even further in the Cayley-Dickson construction series.
We study the representation theory of a certain finite group for which Kloosterman sums appear as character values. This leads us to consider a concrete family of commuting hermitian matrices which have Kloosterman sums as eigenvalues. These matrices satisfy a number of "magical" combinatorial properties and they encode various arithmetic properties of Kloosterman sums. These matrices can also be regarded as adjacency matrices for multigraphs which display Ramanujan-like behavior.
We present an exact method for counting semi-magic squares of order 6. Some theoretical investigations about the number of them and a probabilistic method are presented. Our calculations show that there are exactly $94\,590\,660\,245\,399\,996\,601\,600$ such squares up to reflections and rotations.
A \emph{magic square} is an $n \times n$ array of distinct positive integers whose sum along any row, column, or main diagonal is the same number. We compute the number of such squares for $n=4$, as a function of either the magic sum or an upper bound on the entries. The previous record for both functions was the $n=3$ case. Our methods are based on inside-out polytopes, i.e., the combination of hyperplane arrangements and Ehrhart's theory of lattice-point enumeration.
Similar to how standard Young tableaux represent paths in the Young lattice, Latin rectangles may be use to enumerate paths in the poset of semi-magic squares with entries zero or one. The symmetries associated to determinant preserve this poset, and we completely describe the orbits, covering data, and maximal chains for squares of size 4, 5, and 6. The last item gives the number of Latin squares in these cases. To calculate efficiently for size 6, we in turn identify orbits with certain equivalence classes of hypergraphs.
A magic square of order $n$ with all subsquares of possible orders (ASMS$(n)$) is a magic square which contains a general magic square of each order $k\in\{3, 4, \cdots, n-2\}$. Since the conjecture on the existence of an ASMS was proposed in 1994, much attention has been paid but very little is known except for few sporadic examples. A $k$-extended Langford sequence of defect $d$ and length $m$ is equivalent to a partition of $\{1,2,\cdots,2m+1\}\backslash\{k\}$ into differences $\{d,\cdots,d+m-1\}$. In this paper, a construction of ASMS based on extended Langford sequence is established. As …
We give a simple construction of an orthogonal basis for the space of m by n matrices with row and column sums equal to zero. This vector space corresponds to the affine space naturally associated with the Birkhoff polytope, contingency tables and Latin squares. We also provide orthogonal bases for the spaces underlying magic squares and Sudoku boards. Our construction combines the outer (i.e., tensor or dyadic) product on vectors with certain rooted, vector-labeled, binary trees. Our bases naturally respect the decomposition of a vector space into centrosymmetric and skew-centrosymmetric piec…
This paper aims to address the relation between a magic square of odd order $n$ and a group, and their properties. By the modulo number $n$, we construct entries for each table from initial table of magic square with large number $n^2$. Generalization of the underlying idea is presented, we obtain unique group, and we also prove variants of the main results for magic cubes.
A magic SET square is a 3 by 3 table of SET cards such that each row, column, diagonal, and anti-diagonal is a set. We allow the following transformations of the square: shuffling features, shuffling values within the features, rotations and reflections of the square. Under these transformations, there are 21 types of magic SET squares. We calculate the number of squares of each type. In addition, we discuss a game of SET tic-tac-toe.
It is proved that a certain symmetric sequence of nonnegative integers arising in the enumeration of magic squares of given size n by row sums or, equivalently, in the generating function of the Ehrhart polynomial of the polytope of doubly stochastic n by n matrices, is equal to the h-vector of a simplicial polytope and hence that it satisfies the conditions of the g-theorem. The unimodality of this sequance, which follows, was conjectured by Stanley (1983). Several generalizations are given.
Graph labeling is a well-known and intensively investigated problem in graph theory. Sparse anti-magic squares are useful in constructing vertex-magic labeling for graphs. For positive integers $n,d$ and $d<n$, an $n\times n$ array $A$ based on $\{0,1,\cdots,nd\}$ is called \emph{a sparse anti-magic square of order $n$ with density $d$}, denoted by SAMS$(n,d)$, if each element of $\{1,2,\cdots,nd\}$ occurs exactly one entry of $A$, and its row-sums, column-sums and two main diagonal sums constitute a set of $2n+2$ consecutive integers. An SAMS$(n,d)$ is called \emph{regular} if there are exact…
We present a multivariate generating function for all n x n nonnegative integral matrices with all row and column sums equal to a positive integer t, the so called semi-magic squares. As a consequence we obtain formulas for all coefficients of the Ehrhart polynomial of the polytope B_n of n x n doubly-stochastic matrices, also known as the Birkhoff polytope. In particular we derive formulas for the volumes of B_n and any of its faces.
A magic labelling of a set system is a labelling of its points by distinct positive integers so that every set of the system has the same sum, the magic sum. Examples are magic squares (the sets are the rows, columns, and diagonals) and semimagic squares (the same, but without the diagonals). A magilatin labelling is like a magic labelling but the values need be distinct only within each set. We show that the number of $n\times n$ magic or magilatin labellings is a quasipolynomial function of the magic sum, and also of an upper bound on the entries in the square. Our results differ from previo…
We find the numbers of $3 \times 3$ magic, semimagic, and magilatin squares, as functions either of the magic sum or of an upper bound on the entries in the square. Our results on magic and semimagic squares differ from previous ones in that we require the entries in the square to be distinct from each other and we derive our results not by \emph{ad hoc} reasoning but from the general geometric and algebraic method of our paper "An enumerative geometry for magic and magilatin labellings". Here we illustrate that method with a detailed analysis of $3\times3$ squares.
This article studies a generalization of magic squares to finite projective planes. In traditional magic squares the entries come from the natural numbers. This does not work for finite projective planes, so we instead use Abelian groups. For each finite projective plane we demonstrate a small group over which the plane can labeled magically. In the prime order case we classify all groups over which the projective plane can be made magic.
We give formulas for enumerating directed paths in the graded poset of semi-magic squares of size three. We give two applications of these formulas: an advanced example of Vandermonde convolution for finite graded posets, and a direct method for deriving Regge symmetry formulas for un-normalized Clebsch-Gordan coefficients.
This article studies a generalization of magic squares to $k$-uniform hypergraphs. In traditional magic squares the entries come from the natural numbers. A magic labeling of the vertices in a graph or hypergraph has since been generalized to allow for labels coming from any abelian group. We demonstrate an algorithm for determining whether a given hypergraph has a magic labeling over some abelian group. A slight adjustment of this algorithm also allows one to determine whether a given hypergraph can be magically labeled over $\mathbb{Z}$. As a demonstration, we use these algorithms to determi…
In the theory of Clebsch-Gordan coefficients, one may recognize the domain space as the set of weakly semi-magic squares of size three. Two partitions on this set are considered: a triangle-hexagon model based on top lines, and one based on the orbits under a finite group action. In addition to giving another proof of McMahon's formula, we give a generating function that counts the so-called trivial zeros of Clebsch-Gordan coefficients and its associated quasi-polynomial.
Let $G=(V,E)$ be a graph and $Γ$ an Abelian group both of order $n$. A $Γ$-distance magic labeling of $G$ is a bijection $\ell \colon V\rightarrow Γ$ for which there exists $μ\in Γ$ such that $% \sum_{x\in N(v)}\ell (x)=μ$ for all $v\in V$, where $N(v)$ is the neighborhood of $v$. Froncek %(\cite{ref_CicAus}) showed that the Cartesian product $C_m \square C_n$, $m, n\geq3$ is a $\mathbb{Z}_{mn}$-distance magic graph if and only if $mn$ is even. It is also known that if $mn$ is even then $C_m \square C_n$ has $\mathbb{Z}_α\times \mathcal{A}$-magic labeling for any $α\equiv 0 \pmod {{\rm lcm}(m,…
We present a randomized algorithm, which, given positive integers n and t and a real number 0< epsilon <1, computes the number Sigma(n, t) of n x n non-negative integer matrices (magic squares) with the row and column sums equal to t within relative error epsilon. The computational complexity of the algorithm is polynomial in 1/epsilon and quasi-polynomial in N=nt, that is, of the order N^{log N}. A simplified version of the algorithm works in time polynomial in 1/epsilon and N and estimates Sigma(n,t) within a factor of N^{log N}. This simplified version has been implemented. We present resul…
We describe a generalization of most-perfect magic squares, called type-p most-perfect squares, and in prime-power orders we give a linear construction of these squares reminiscent of de la Loubere's classical magic square construction method. Type-p most-perfect squares can be used to construct other interesting squares (e.g., generalized Franklin squares) and our linear construction may have implications for counting type-p most-perfect squares.
Explicit algorithms are developed for constructing odd order n pandiagonal latin cubes in 3 and 4 dimensions, and these are used to construct pandiagonal magic cubes and 4 dimensional hypercubes, respectively. It is established that these structures exist in 3 dimensions only for odd orders n not less than 11, and in 4 dimensions only for odd orders n not less than 17. Estimates for the number of such structures as functions of n in 3 and 4 dimensions are also presented.
Choi Seok-Jeong studied Latin squares at least 60 years earlier than Euler although this was less known. He introduced a pair of orthogonal Latin squares of order 9 in his book. Interestingly, his two orthogonal non-double-diagonal Latin squares produce a magic square of order 9, whose theoretical reason was not studied. There have been a few studies on Choi's Latin squares of order 9. The most recent one is Ko-Wei Lih's construction of Choi's Latin squares of order 9 based on the two $3 \times 3$ orthogonal Latin squares. In this paper, we give a new generalization of Choi's orthogonal Latin …
A $(p,q,r)$-board that has $pq+pr+qr$ squares consists of a $(p,q)$-, a $(p,r)$-, and a $(q,r)$-rectangle. Let $S$ be the set of the squares. Consider a bijection $f : S \to [1,pq+pr+qr]$. Firstly, for $1 \le i \le p$, let $x_i$ be the sum of all the $q+r$ integers in the $i$-th row of the $(p,q+r)$-rectangle. Secondly, for $1 \le j \le q$, let $y_j$ be the sum of all the $p+r$ integers in the $j$-th row of the $(q,p+r)$-rectangle. Finally, for $1\le k\le r$, let $z_k$ be the the sum of all the $p+q$ integers in the $k$-th row of the $(r,p+q)$-rectangle. Such an assignment is called a $(p,q,r)…
A knight's tour on a board is a sequence of knight moves that visits each square exactly once. A knight's tour on a square board is called magic knight's tour if the sum of the numbers in each row and column is the same (magic constant). Knight's tour in higher dimensions (n > 3) is a new topic in the age-old world of knight's tours. In this paper, it has been proved that there can't be magic knight's tour or closed knight's tour in an odd order n-dimensional hypercube. 3 \times 4 \times 2n-2 is the smallest cuboid (n \geq 2) and 4 \times 4 \times 4n-2 is the smallest cube in which knight's to…
For prime $p$ we define magic squares of order $kp^3$, called type-$p$ Franklin squares, whose properties specialize to those of classical Franklin squares in the case $p=2$. We construct type-$p$ Franklin squares in prime-power orders.
Weighted sums of left and right hand Kronecker products of Integer Sequence Doubly Affine (ISDA) as well as Generalized Arithmetic Progression Doubly Affine (GAPDA) arrays are used to generate larger ISDA arrays of multiplicative order (compound squares) from pairs of smaller ones. In two dimensions we find general expressions for the eigenvalues (EVs) and singular values (SVs) of the larger arrays in terms of the EVs and SVs of their constituent matrices, leading to a simple result for the rank of these highly singular compound matrices. Since the critical property of the smaller constituent …
The projection construction has been used to construct semifields of odd characteristic using a field and a twisted semifield [Commutative semifields from projection mappings, Designs, Codes and Cryptography, 61 (2011), 187--196]. We generalize this idea to a projection construction using two twisted semifields to construct semifields of odd characteristic. Planar functions and semifields have a strong connection so this also constructs new planar functions.