PulseExploreJournal ClubDebatesTrendingResearchersJournals
Instagram
HomeExploreJournal ClubTrending
Synapse
⌘+K
Synapse
April 1, 2026Computational and Applied Mathematics0 citationsOpen Access

Constructing magic squares: an integer constraint satisfaction problem and a fast approach

JPJoão Vitor PamplonaMPMaria Eduarda PinheiroLSLuiz-Rafael Santos

Key Points

  • The study aims to develop a method for constructing magic squares efficiently, addressing the limitations of traditional approaches as the order increases.
  • Formulated an integer constraint satisfaction problem for magic squares.
  • Developed a fast construction method based on whether order n is odd, singly even, or doubly even.
  • Provided proof of the correctness of the proposed method.
  • Successfully constructed magic squares of order up to 70,000 in under 140 seconds.
  • Demonstrated significant improvements in efficiency compared to traditional methods.

Abstract

Abstract Magic squares are a fascinating mathematical challenge that has intrigued mathematicians for centuries. Given a positive (and possibly large) integer n n, one of the main challenges that still remains is to find, within a reasonable computational time, a magic square of order n n, that is, a square matrix of order n n with unique integers from a a min to a a max, such that the sum of each row, column, and diagonal equals a constant C (A) C (A). In this work, we first present an integer constraint satisfaction problem for constructing a magic square of order n n. Nonetheless, the solution time of this problem grows exponentially as the order increases. To overcome this limitation, we also propose a fast approach that constructs magic squares depending on whether n 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 70 000 in less than 140 seconds, demonstrating its efficiency and scalability.

Ask AI
Helpful
Bookmark
Share
View Full Paper

Cite This Study

Pamplona et al. (2026) studied this question.

synapsesocial.com/papers/69cd7b575652765b073a9496https://doi.org/10.1007/s40314-026-03731-3
Ask AI
Helpful
Bookmark
Share
View Full Paper