The complete count of the special order-three magic squares
ProvedMagicSquares.special_three_countThe special classes of order-three magic squares, counted completely.
Let be the number of panmagic (pandiagonal) squares of order three and line sum — those arrays of nonnegative integers whose rows, columns and all six broken diagonals sum to — and let be the number of symmetric magic squares of order three and line sum . The theorem determines both, for every :
What the answers say. Where MacMahon's count for the plain magic squares of order three is quadratic (), the two special classes are degenerate in opposite ways. The six broken diagonals are so restrictive that they collapse the whole two-parameter family to the single constant square: for line sum that is the array all of whose entries equal . Symmetry, by contrast, removes only three of the eight line conditions, and what survives is a genuine one-parameter family
giving the linear count . In both cases the divisibility obstruction for
order-three magic squares — the centre equals one third of the line sum, by
center_of_order_three — forces the vanishing off multiples of three.
Proof. The two evaluations at are supplied by pan_three_card and by
symm_three_bij composed with the cardinality of the parameter interval
; the two vanishing cases are supplied by
pan_three_otherwise and symm_three_otherwise, both of which reduce to the
centre identity. Splitting on whether and substituting finishes
the count.
Context. This is the fourth and last instalment of the order-three programme: after counting all squares (Mission I), all semi-magic ones (Mission II) and classifying the normal ones (Mission III), the special classes complete the picture. The comparison between the three counts — quadratic, linear and constant — is the point of the order-three study, and it is what is lost at order four, where no closed form is known.
import Mathlib import Definitions.Def_MagicSquares import Definitions.Def_MagicSquaresSpecial3 open MagicSquares
namespace MagicSquares
theorem special_three_count (t : ℕ) :
panMagicCount 3 t = (if 3 ∣ t then 1 else 0) ∧
symmetricMagicCount 3 t = (if 3 ∣ t then 2 * (t / 3) + 1 else 0) := by sorry
end MagicSquares
Confirmed by the mission captain (proposal self-audit).