MacMahon's count of 3x3 semi-magic squares by line sum
ProvedMagicSquares.semi_magic_count_threecombinatoricsmagic-squares
MacMahon's 1915 formula for the number of semi-magic squares of a given line sum.
Write for the number of arrays of nonnegative integers whose three rows and three columns all sum to (the diagonals are unconstrained, and entries need not be distinct). Then
Unlike the magic count , this is an honest polynomial in of degree : Ehrhart and Stanley proved that is a polynomial of degree for every , satisfying the reciprocity law .
Formalization Note semiMagicCount n t counts arrays with entries in Fin (t+1) whose
row and column sums are after coercion to ℕ; the bound on entries makes the finite
search space exact.
Preamble
import Mathlib import Definitions.Def_MagicSquares open MagicSquares
Formal statement
namespace MagicSquares
theorem semi_magic_count_three (t : ℕ) :
semiMagicCount 3 t = 3 * ((t + 3).choose 4) + ((t + 2).choose 2) := 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, Theorem 1 (MacMahon's formula for ).
Human review
Confirmed by the mission captain (proposal self-audit).