2025/04/28 by João Vitor Pamplona, Pamplona, João Vitor, Maria Eduarda Pinheiro +3
Computer Science · Engineering · Mathematics · #Analytic Number Theory Research #FOS: Mathematics #Graph Labeling and Dimension Problems #Optimization and Control (math.OC) #graph theory and CDMA systems
paper · pdf · doi:10.48550/arxiv.2504.20017
openalex publication_date 2025/04/28 · openalex created_date 2025/10/10 · openalex updated_date 2026/07/28
Magic squares are a fascinating mathematical challenge that has intrigued mathematicians for centuries. Given a positive (and possibly large) integer \( n \), one of the main challenges that still remains is to find, within a computational time, a magic square of order \( n \), that is, a square matrix of order \( n \) with unique integers from \( amin \) to \( amax \), such that the sum of each row, column, and diagonal equals a constant \( C(A) \). In this work, we first present an integer constraint satisfaction problem for constructing a magic square of order \( n \). Nonetheless, the solution time of this problem grows exponentially as the order increases. To overcome this limitation, we also propose a that constructs magic squares depending on whether \( n \) is odd, singly even, or doubly even. Moreover, we provide a proof of the correctness of this novel approach. Our numerical results show that our method can construct magic squares of order up to \num70000 in less than \num140 seconds, demonstrating its efficiency and scalability.