MacMahon's count of 3x3 magic squares with line sum a multiple of 3
ProvedMagicSquares.magic_count_three_divisiblecombinatoricsmagic-squares
MacMahon's 1915 count of magic squares whose line sum is a multiple of .
Write for the number of arrays of nonnegative integers whose three rows, three columns and two main diagonals all sum to (entries need not be distinct). Then vanishes unless , and for ,
which is the integral form of .
The companion statement MagicSquares.magic_count_three_otherwise records the vanishing when
; together they give the complete counting function.
Formalization Note magicCount n t counts arrays with entries in Fin (t+1) satisfying
the magic identities after coercion to ℕ. This is lossless because every entry of a
nonnegative magic square with line sum is at most .
Preamble
import Mathlib import Definitions.Def_MagicSquares open MagicSquares
Formal statement
namespace MagicSquares
theorem magic_count_three_divisible (e : ℕ) :
magicCount 3 (3 * e) = 2 * e ^ 2 + 2 * e + 1 := by sorry
end MagicSquaresSource
Beck, Cohen, Cuomo & Gribelyuk, The number of ``magic'' squares, cubes and hypercubes, Amer. Math. Monthly 110 (2003), 707-717; arXiv:math/0201013v3, Section 2, MacMahon's formula for (1915).
Human review
Confirmed by the mission captain (proposal self-audit).