Interactive academic note

Magic squares as spectral height fields

A normal magic square is a constrained permutation of heights over a lattice. Its centered 3D covariance is almost too forgiving, so this paper studies multiscale energy spectra that expose local structure.

Formal model

From mass balance to spectral geometry

Centered coordinates X_j = 2j-(n-1), Y_i = 2i-(n-1)
Centered height Z_ij = 2a_ij-(n²+1)
Magic constraints Σ_row Z = Σ_col Z = Σ_diag Z = 0
Energy spectrum H_p(k) = -Σ_W P_p(W) log P_p(W)

The ordinary 3D covariance is fixed by the value set and line constraints. The geometric signal moves into higher-order and multiscale quantities, especially local energy distributions E_p(W)=Σ|Z|^p across all windows of scale k.

0
2

Example square

Square

magic

Centered height field

3D render

Bars rise from the lattice by centered height Z. The camera is fixed so comparisons are stable across classes.

Line balance

Magic constraints as residuals

Spectral signature

Entropy by scale and exponent

Higher p concentrates attention on extreme centered values. Intermediate window scales are where valid and invalid squares usually separate.

Statistical summary

Current invariants

Local imbalance

Window residual distribution

Uses signed sums ΣZ over all k × k windows. Magic lines vanish, but local windows need not.