Here is Lee Morgenstern's method, above used by Frank Rubin in May-July 2009 for 3x3 nearly-magic squares of squares with close sums. This method uses Hillyer's formula of Pythagorean Triangles having equal areas, and Newton's method of finding a root of a polynomial: See Morgenstern's ...