Suzanne Alejandre’s site gives a good introduction to magic squares.
Mutsumi Suzuki also provides a comprehensive set of links about magic squares.
See the related magic hexagon problem entry.
Numerous other links exist on the web.
Various code is available online for finding magic squares and other related problems:
[PesantQZ12]
Counting-Based Search: Branching Heuristics for Constraint Satisfaction Problems
J. Artif. Intell. Res. (JAIR),
2012