Magic constant of a normal magic square
ProvedMagicSquares.magic_constant_of_normalcombinatoricsmagic-squares
Every normal magic square has the magic constant .
Let be an array whose entries are exactly the integers , each used once, and suppose every row, every column and both main diagonals of sum to the same number . Then
Equivalently , the classical magic constant: it is of the sum of all entries.
Formalization Note The division by is avoided by multiplying through, so the statement is an identity in . Normality is the conjunction of the entry bounds with injectivity of the index-to-entry map.
Preamble
import Mathlib import Definitions.Def_MagicSquares open MagicSquares
Formal statement
namespace MagicSquares
theorem magic_constant_of_normal (n : ℕ) (M : Square n ℕ) (s : ℕ)
(hN : IsNormal M) (hM : IsMagic M s) :
2 * s = n * (n ^ 2 + 1) := by sorry
end MagicSquaresSource
Standard folklore; stated e.g. in Weisstein, MathWorld, "Magic Square", eq. for the magic constant of a normal magic square.