Table of Contents
Fetching ...

Algebraic Classification of All 880 Fourth-Order Magic Squares and the Discovery of Complete Alternating Magic Squares

Kenichi Takemura

TL;DR

This work introduces the Alternating Power Difference (APD), an algebraic invariant defined via $\operatorname{APD}_m(A)=\sum_{\sigma\in S_n} \operatorname{sgn}(\sigma)\, f_A(\sigma)^m$ with $f_A(\sigma)=\sum_{i=1}^n A_{i,\sigma(i)}$, to classify all $880$ order-$4$ magic squares beyond traditional geometric schemes. Through exhaustive computation, the squares are partitioned into 51 APD groups and three $m_1$-based classes, revealing a remarkable subset of 16 squares in which $APD_m(A)=0$ for all $m$ (Complete Alternating Magic Squares), a property that persists under matrix squaring in a controlled descent to $m_1=4$. The study links APD to link-line patterns, showing coarse alignment with the geometric classification while exposing hidden algebraic symmetries; it also uncovers discrete APD value structures and a surprising connection to elliptic curve torsion orders via normalization factors. Collectively, APD offers a powerful invariant capturing hidden symmetry in magic squares, enabling a refined, reproducible algebraic framework and suggesting deep connections between combinatorics, group theory, and number theory with potential generalizations to higher orders and related combinatorial objects.

Abstract

In this paper, we introduce a newly defined algebraic invariant for square matrices termed the \emph{Alternating Power Difference (APD)}. The APD is defined as the signed sum of the powers of diagonal sums along permutations of the symmetric group, distinguishing between even and odd permutations. It serves as a measure of the broken even-odd symmetry inherent in a matrix through higher-order moments. We applied this invariant to all 880 essentially different normal $4\times4$ magic squares (excluding symmetries) and defined the \emph{First Appearance Degree} $m_1$ as the minimum power at which the APD first becomes non-zero. Through an exhaustive computational search, we found that these magic squares are categorized into three clearly separated classes: $m_1=3$ (240 squares), $m_1=4$ (624 squares), and $m_1=\infty$ (16 squares). In particular, the case $m_1=\infty$ identifies exceptionally rare magic squares for which the APD vanishes at all degrees. We refer to these as \emph{Complete Alternating Magic Squares} and demonstrate that they possess a strong algebraic symmetry undetectable by conventional geometric classifications or link-line patterns. Furthermore, we reveal that the APD-based classification refines the classical link-line classification based on complementary sum pairs, showing that each geometric type is clearly distinguished by its first appearance degree. All results in this paper are based on exhaustive computations and are fully reproducible. Our findings suggest that the APD is an effective new invariant for detecting hidden algebraic structures in magic squares and related combinatorial matrices.

Algebraic Classification of All 880 Fourth-Order Magic Squares and the Discovery of Complete Alternating Magic Squares

TL;DR

This work introduces the Alternating Power Difference (APD), an algebraic invariant defined via with , to classify all order- magic squares beyond traditional geometric schemes. Through exhaustive computation, the squares are partitioned into 51 APD groups and three -based classes, revealing a remarkable subset of 16 squares in which for all (Complete Alternating Magic Squares), a property that persists under matrix squaring in a controlled descent to . The study links APD to link-line patterns, showing coarse alignment with the geometric classification while exposing hidden algebraic symmetries; it also uncovers discrete APD value structures and a surprising connection to elliptic curve torsion orders via normalization factors. Collectively, APD offers a powerful invariant capturing hidden symmetry in magic squares, enabling a refined, reproducible algebraic framework and suggesting deep connections between combinatorics, group theory, and number theory with potential generalizations to higher orders and related combinatorial objects.

Abstract

In this paper, we introduce a newly defined algebraic invariant for square matrices termed the \emph{Alternating Power Difference (APD)}. The APD is defined as the signed sum of the powers of diagonal sums along permutations of the symmetric group, distinguishing between even and odd permutations. It serves as a measure of the broken even-odd symmetry inherent in a matrix through higher-order moments. We applied this invariant to all 880 essentially different normal magic squares (excluding symmetries) and defined the \emph{First Appearance Degree} as the minimum power at which the APD first becomes non-zero. Through an exhaustive computational search, we found that these magic squares are categorized into three clearly separated classes: (240 squares), (624 squares), and (16 squares). In particular, the case identifies exceptionally rare magic squares for which the APD vanishes at all degrees. We refer to these as \emph{Complete Alternating Magic Squares} and demonstrate that they possess a strong algebraic symmetry undetectable by conventional geometric classifications or link-line patterns. Furthermore, we reveal that the APD-based classification refines the classical link-line classification based on complementary sum pairs, showing that each geometric type is clearly distinguished by its first appearance degree. All results in this paper are based on exhaustive computations and are fully reproducible. Our findings suggest that the APD is an effective new invariant for detecting hidden algebraic structures in magic squares and related combinatorial matrices.
Paper Structure (45 sections, 13 equations, 2 figures, 8 tables)

This paper contains 45 sections, 13 equations, 2 figures, 8 tables.

Figures (2)

  • Figure 1: Geometric patterns of 12 Connection Line Types
  • Figure 2: Complete Alternating Magic Squares 1--16 (G51 Group)

Theorems & Definitions (9)

  • Definition 1: Fourth-Order Magic Square
  • Definition 2: Link-Line
  • Remark 1
  • Definition 3: Function derived from a matrix
  • Definition 4: Alternating Power Difference
  • Remark 2
  • Definition 5: First Appearance Degree
  • Definition 6: First Appearance Value
  • Definition 7: Complete Alternating Magic Square